How do I add an Implementation-Version value to a jar manifest using Maven?
26,229
You would use the Maven Archiver:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
This will add the following to the manifest file:
Implementation-Title: ${pom.name}
Implementation-Version: ${pom.version}
Implementation-Vendor-Id: ${pom.groupId}
Implementation-Vendor: ${pom.organization.name}
Comments
-
izb almost 4 years
I'd like to add an Implementation-Version line to a manifest in my jar file that reflects the POM version number. I can't for the life of me work out how to do this using the jar plugin.
Is this possible?
-
dfa almost 15 years${buildNumber}? How about this variable?
-
Ascalonian almost 15 yearsSorry, that wasn't needed. I was just showing other Implementation values to set.
-
Ascalonian almost 15 yearsAnytime! I have run into this issue before so I am just glad I can share what I learned with someone else :-)
-
DagR over 11 yearsTo make it work for an EAR:
<artifactId>maven-ear-plugin</artifactId>
-
Brad Turek over 6 yearsIs there a way to do this with a one-liner property? I'm wondering if it works in a similar way to:
<maven.compiler.target>1.8</maven.compiler.target>