I want the project version number to be like the following format for the normal version release:
<version>1.0-SNAPSHOT</version>
<version>1.0.1-SNAPSHOT</version>
......
On the other hand, I want to have a built-in artifact for each merge, as shown below:
<version>1.0-SNAPSHOT-${timestamp}</version>
Can I achieve this using the maven profile? sort of:
<profiles>
<profile>
<id>normal</id>
<version>1.0-SNAPSHOT<version>
</proifle>
<profile>
<id>build</id>
<version>1.0-SNAPSHOT-${timestamp}<version>
</proifle>
</profiles>
so that I can build it like this:
mvn package -P normal
or
mvn package -P build
If a profile can solve this problem, what are the other approaches?
source
share