I need to have Maven insert the version number from the POM file into the manifest located in the WAR file under /WEB-INF/manifest.mf.
How do I do this? I was able to easily file documentation for doing this in a JAR file using the maven-jar-plugin, but that does not work on a WAR file.
Thanks for the help!
Or you can use the addDefaultImplementationEntries or addDefaultSpecificationEntries flags which will add several entries including the
project.version
property.addDefaultImplementationEntries
addDefaultSpecificationEntries
Default value for both is false. If a property is not defined (e.g.
project.organization.name
), then that line will be excluded from the manifest.This could go into the maven-war-plugin configuration as follows:
Put
${project.version}
in your manifest.mf where you want the version to be. In order for this to work, I believe you need the resources plugin so that manven will 'filter' resources as they are included in your war file.Figured it out using the maven-war-plugin. See the configuration below: