Maven’s jar plugin will automatically add a “pom.properties” in your jar’s META-INF/maven/$groupId/$artifactId directory. If you build with hudson, there are a number of other values that you might want to include automatically, though, like the SVN revision number that the artifact was built from, and when it was built.
Here’s the configuration for the maven-jar-plugin that adds a couple of the more-interesting hudson variables to your module’s jar’s META-INF/MANIFEST.MF:
[xml highlight="12,13,14,15"]
<project>
…
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.2</version>
<configuration>
<archive>
<manifestEntries>
<Svn-Revision>${SVN_REVISION}</Svn-Revision>
<Build-Tag>${BUILD_TAG}</Build-Tag>
<Build-Number>${BUILD_NUMBER}</Build-Number>
<Build-Id>${BUILD_ID}</Build-Id>
</manifestEntries>
</archive>
</configuration>
</plugin>
[/xml]
The Maven Guide to Working with Manifests and Maven Archiver pages, along with the other hudson variables may prove helpful.
Update December 14, 2009:
Note that Hudson’s SVN_REVISION macro is empty if you build your project as a maven multi-module.