<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-buildnumber</id>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
<configuration>
<format>{0,number}</format>
<items>
<item>buildNumber0</item>
</items>
<buildNumberPropertyName>buildNumberSeq</buildNumberPropertyName>
</configuration>
</execution>
<execution>
<id>generate-timestamp</id>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
<configuration>
<format>{0,date,dd-MM-yyyy}</format>
<items>
<item>timestamp</item>
</items>
<buildNumberPropertyName>buildDate</buildNumberPropertyName>
</configuration>
</execution>
</executions>
</plugin>
Now, I can use this data using ${buildDate} and ${buildNumberSeq} instead of ${buildNumber}.
buildnumber-maven-plugin
本文介绍了一种使用Maven构建插件的方法,通过配置不同的执行阶段来生成构建编号和时间戳,使得可以在构建过程中使用这些变量。

被折叠的 条评论
为什么被折叠?



