The pom.xml builds jars with classifiers(for dev, test, stage environments).
E.g.
<profiles>
<profile>
<id>dev</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>jenkins-dev</id>
<properties>
<jar.classifier>default-jenkins-dev</jar.classifier>
...............
</profile>
There are 2 branches in mercurial(default, second).
So in the second branch the jar classifier is ‘second-jenkins-dev’.
There are several modules(e.g. A, B, C)
The problem occurs when some my modules from default branch were build latest(The latest jar by time of A module is A-default-jenkins-dev.jar) And I try to build the whole war of the ‘second’ branch. Instead of having the A-second-jenkins-dev.jar as a dependnecy, I get
A-default-jenkins-dev.jar
Could someone help?
I think your strategy to use profile to select the branch to build is confusing and error prone (but that’s only personnal opinion).
I think you need to check the following to help you solving your issue:
Alternative solution:
Modify the pom(s) in branch
secondand don’t play with profiles to handle this. Use the artifact<version>to handle branches. Keep the<classifier>to make distinction between artifact type (for instance you can build a src jar and a class jar based on the same code : that’s the idea behind maven classifier)