Close versions of parent maven project and child project pointing to each other

32 Views Asked by At

if I have a parent maven project like this with somes dependencies and one which is a library that I created:

<project xmlns="http://maven.apache.org/POM/4.0.0"   
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0   
http://maven.apache.org/xsd/maven-4.0.0.xsd">        
  
  <groupId>com.myapps</groupId>  
  <artifactId>my-app</artifactId>  
  <version>1.0.0-SNAPSHOT</version> 
  <packaging>pom</packaging>

  <dependencies> 
    <dependency>  
     <groupId>com.mylibraries</groupId>  
     <artifactId>my-library</artifactId>  
     <version>1.0.0-SNAPSHOT</version>         
    </dependency> 

    //other dependencies 

  </dependencies>       
</project> 

And I have the pom of my library

<project xmlns="http://maven.apache.org/POM/4.0.0"   
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0   
http://maven.apache.org/xsd/maven-4.0.0.xsd">  
  <parent>
    <groupId>com.myapps</groupId>
    <artifactId>my-app</artifactId>
    <version>1.0.0-SNAPSHOT</version>
  </parent>      

  <groupId>com.mylibraries</groupId>  
  <artifactId>my-library</artifactId>  
  <version>1.0.0-SNAPSHOT</version>
</project> 

I have this configuration in order any project can point to the maven parent project and that parent manages the version of my own library and any other third libraries. Now I want to close versions in the parent project and in my library. How to do it if there is some circular relationship and I want both to point to a closed version of each other?. I mean, If I close version in the parent project first,it will point to my snapshot library with no closed version and if I do just the opposite, my library project will point to a snapshot parent.

0

There are 0 best solutions below