Maven System + Date
3 answers
Using the build-number-maven-plugin allows you to generate a property that can then be used on the property finalName
.
The following configuration sets a timestamp property with the required format and then changes finalName to use this property and results in an artifact with that name, which is printed to the target directory.
Note that this name is ignored when installing / deploying the artifact, otherwise Maven will not be able to reliably find the artifacts.
<build>
<finalName>${buildNumber}_${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.0-beta-3</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<format>{0,date,yyyyMM}</format>
<items>
<item>timestamp</item>
</items>
</configuration>
</plugin>
...
</plugins>
...
</build>
+4
source to share
maybe this link will help you:
http://commons.ucalgary.ca/projects/maven-buildnumber-plugin/howto.html
+2
source to share