diff --git a/jar/plugin.jelly b/jar/plugin.jelly index 81fc1826..eec3b189 100644 --- a/jar/plugin.jelly +++ b/jar/plugin.jelly @@ -83,9 +83,11 @@ - - - + + + + + @@ -94,20 +96,11 @@ - + - - - - - - - - + @@ -146,14 +139,48 @@ - + + + + + + + + + + + + + + ${pomCurrentVersion} + + + + + + + + + + + + + + + + + + + + ${maven.jar.manifest.attributes.list} - - - + + + - + + ${maven.jar.manifest.groups.list} diff --git a/jar/project.xml b/jar/project.xml index ce8f26ee..44b97063 100644 --- a/jar/project.xml +++ b/jar/project.xml @@ -59,6 +59,15 @@ commons-jelly-tags-velocity 1.0 + + commons-lang + commons-lang + 2.0 + http://jakarta.apache.org/commons/lang/ + + This library is already loaded by maven's core. Be careful to use the same version number as in the core. + + velocity velocity diff --git a/jar/xdocs/changes.xml b/jar/xdocs/changes.xml index c254132e..fbf250e4 100644 --- a/jar/xdocs/changes.xml +++ b/jar/xdocs/changes.xml @@ -25,6 +25,13 @@ + Support specificationVersion in manifest. + + Jar plugin generates incorrect manifest file. + + + + java:compile and java:jar-resources should be called before the jar goal to create the good directory structure. It was done in test:test before but it's also a prerequisite for jar:jar. Remove unused properties from documentation. Document need for jar.manifest.classpath property. diff --git a/jar/xdocs/manifest.xml b/jar/xdocs/manifest.xml new file mode 100644 index 00000000..4021032a --- /dev/null +++ b/jar/xdocs/manifest.xml @@ -0,0 +1,145 @@ + + + + + + + The Manifest + + + +
+

+ Here is a typical manifest file generated by the maven-jar-plugin-1.8: +

+ Manifest-Version: 1.0 +Ant-Version: Apache Ant 1.6.5 +Created-By: 1.4.2_10-b03 (Sun Microsystems Inc.) +Built-By: lukas +Maven-Version: 1.1-beta-3-SNAPSHOT + +Name: org/apache/maven +Extension-name: org.apache.maven +Specification-Title: Create jar files +Specification-Vendor: Apache Software Foundation +Specification-Version: 1.8 +Implementation-Title: org.apache.maven +Implementation-Vendor: Apache Software Foundation +Implementation-Version: 1.8-SNAPSHOT +

+ Note that the structure was different and probably not compatible in older versions + of the plugin, see MPJAR-36. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDefault value
Created-ByThe java version used to generate the manifest file
Built-By${user.name}
Maven-Version${maven.application.version}
Class-Path + See the maven.jar.manifest.classpath.add + property. +
Main-Class + See the maven.jar.mainclass + property. +
Extension-List + See the maven.jar.manifest.extensions.add + property. +
Name${pom.package} with "." (dot) replaced by "/" (slash)
Extension-name${pom.package}
Specification-Title${pom.shortDescription} (trimmed to 46 characters)
Specification-Vendor${pom.organization.name}
Specification-Version + This is constructed from ${pom.currentVersion} in the following way: + first any occurence of the string "-SNAPSHOT" is chopped off, + the rest is then tokenized with a delimiter "." (dot), and + up to three tokens are kept. Note that according to + Sun's specification + this must be a number to compare, so if your ${pom.currentVersion} contains any + non-digit character (apart from "."), the resulting manifest will not be valid. + You should then override this default (see below). +
Implementation-Title${pom.package}
Implementation-Vendor${pom.organization.name}
Implementation-Version${pom.currentVersion}
+
+ +

+ Any of the above default values can be overridden by specifying + a custom manifest file via the maven.jar.manifest + property. Note that values in manifest + sections (separated from the main section by a blank line) can + only be overridden by also specifying the section name. + For instance, even if you only want to override the + Specification-Version in the example above, + you need at least the following in your custom manifest: +

+ Name: org/apache/maven +Specification-Version: 1.8.0 +
+
+ +
diff --git a/jar/xdocs/navigation.xml b/jar/xdocs/navigation.xml index 67c794bf..af3e3d4c 100644 --- a/jar/xdocs/navigation.xml +++ b/jar/xdocs/navigation.xml @@ -32,6 +32,7 @@ +