If someone can help me here, it will save me a lot of time.
I maintain an open source library that pops into the sonata repository. I make changes to this library several times a day and push it into the 1.0_snapshot assembly using mvn deploy. Let me call him project1
I am constantly working on another project that uses this library to call it project2.
Right now, whenever I make changes to project 1 or 2, I need to first create and deploy project 1 in the repo, and then build project 2 so that it downloads a new copy of project1.jar
Project2 has Project1 as a dependency in pom.xml:
<dependency> <groupId>com.group</groupId> <artifactId>project1</artifactId> <version>1.0-SNAPSHOT</version> </dependency>
to build in such a way that all my changes can be tested, I have to do something like this:
mvn -f ./project1/pom.xml clean deploy mvn -U -f ./project2/pom.xml clean package
this loads my project1.jar into sonatype, then project2 loads a new snapshot and builds it.
This is a simplified picture of what I am doing on a larger scale, where my compilers take 5 minutes and load.
Question: What is the correct way to use maven, so it knows how to use the project1 source depending on project 2?
source share