I have parent project "parent", which has three modules like:
<groupId>com.dummy.bla.bla</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>A</module>
<module>B</module>
<module>C</module>
</modules>
and three modules are depending on each other like a chain:
A<--B<--C
When I run the build under parent, I will have A-1.0-SNAPSHOT.jar generated first, then B-1.0-SNAPSHOT.jar, finally C-1.0-SNAPSHOT.jar.
Then problem is that, I have another maven profile to generate nightly build every day.In my parent pom.xml I have:
<build>
<profile>
<id>nightlybuild</id>
<finalName>${artifcateId}-${buildNumber}</finalName>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
<format>{0,date,yyyy-MM-dd_HH-mm}_{1}</format>
<items>
<item>timestamp</item>
<item>${user.name}</item>
</items>
</configuration>
</plugin>
</build>
Then I have problem to build all the modules using the profile "nighlybuild", because it firstly generates A-${buildNumber}.jar, then when it builds B, it fails to look for A-1.0-SNAPSHOT.jar(because under B/pom.xml I have A as a dependency with version 1.0-SNAPSHOT). Is there anyway the pom.xml under B can have something like:
if(normal build) {
dependency A version is: 1.0-SNAPSHOT
}
if(nightly build) {
dependency A version is: ${buildNumber}
}