I'm including a newVersion propery form an external file using:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<!-- Read in newVersion.properties instead of newVersion property -->
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${session.executionRootDirectory}/newVersion.properties</file>
</files>
</configuration>
</execution>
</plugin>
I'm also using versions:set to set the new version of the code from a CI build.
This works if I run:
mvn -DBUILD_NUMBER=99 initialize versions:set
IOW, I need to specify the "initialize" goal explicitly or it stops and prompts me for the newVersion because it defaults to running the versions:set goal before initialize goal.
How can I define the initialize goal as a dependency of the versions:set goal?
IMO I should not need to define intermediate target ordering.
Note, I know I could use the versions plugin to do all of this but I need to manage gradle and maven versions from a parent gradle script, so I need the base newVersion to come from an external source so that I can use it from multiple build environments.