java - maven-buildnumber-plugin svn revision available only when not using format -
while using maven-buildnumber-plugin 1.0 beta 4, seems can svn revision unless use <format>
tag within configuration. once use <format>
, <item>buildnumber</item>
tag, auto-incrementing number, no longer corresponds svn revision , don't know how back. there way use svn revision number within <format>
? documentation isn't clear.
the buildnumber-maven-plugin pretty darn quirky, why it's still beta. format items wish apply java message format , in cases, useful timestamps , literal strings. if don't need timestamp don't use format option when getting subversion revision number. if use format, indicated, it'll give build number increments 1 rather scm version number.
if need timestamp or have other items deriving buildnumber plugin subversion revision, each 1 separate executions. here's example of how subverison revision number , build timestamp using 2 separate executions of plugin:
<plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>buildnumber-maven-plugin</artifactid> <version>1.0-beta-4</version> <executions> <execution> <id>generate-buildnumber</id> <phase>validate</phase> <goals> <goal>create</goal> </goals> <configuration> <uselastcommittedrevision>true</uselastcommittedrevision> <buildnumberpropertyname>buildrevision</buildnumberpropertyname> </configuration> </execution> <execution> <id>generate-timestamp</id> <phase>validate</phase> <goals> <goal>create</goal> </goals> <configuration> <format>{0,date,yyyy-mm-dd hh:mm:ss}</format> <items> <item>timestamp</item> </items> <buildnumberpropertyname>builddatetime</buildnumberpropertyname> </configuration> </execution> </executions> </plugin>
the key making work using buildnumberpropertyname element. checkout plugin's usage page more information usefulness of java message format for.
Comments
Post a Comment