Skip to content

Instantly share code, notes, and snippets.

@holyjak holyjak/pom.xml

Created May 22, 2013
Embed
What would you like to do?
Pom setup to include git/svn/mercurial revision in the generated MANIFEST.MF file
<project>
<build>
<plugins>
<plugin>
<!-- Create the property $buildNumber holding the current Git revision -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifestEntries>
<Implementation-Title>${project.name}</Implementation-Title>
<!-- buildNumber is produced at runtime by buildnumber-maven-plugin -->
<Implementation-Version>${project.version} ${buildNumber}</Implementation-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.