Unfortunately, jar manifests by itself do not have any standard for version numbering.
But, actually, there is another standard way of getting revision number updated automatically. You could use svn:keywords in order to get current revision number in your files after each commit. There is $Revision$
property for revision substitution and $HeadURL$
for repository URL substitution. You just need to put following string into the file and place this file under version control:
$Revision$ $HeadURL$
If you create manifest on the fly with maven, I would recommend putting following content into version.properties
file:
revision=$Revision$
repourl=$HeadURL$
Then include in into pom.xml
with the statement (maven should have properties plugin enabled):
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-1</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>version.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
And then you will be able to put revision number and repo url to the manifest:
<manifest>
<attribute name="Revision" value="${revision}" />
<attribute name="Repository URL" value="${repourl}" />
</manifest>
Please also note that you will need to explicitly enable svn:keywords
using subversion properties in order to get $Revision$
and $HeadURL$
substituted in your file with actual values. If you will decide to use version.properties
, you will need to run following command:
svn propset svn:keywords Revision version.properties
svn propset svn:keywords HeadURL version.properties