Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Labels:None
-
Number of attachments :
Description
Here is a patch that allows use of user-supplied manifest file.
This user-supplied manifest file will be merged with Maven-supplied properties (Created-By, version properties etc.) and included in JAR-file. If there is no user-supplied manifest file the behaviour is the same as now - just Maven-generated properties will be in manifest file included in JAR-file. User may set property maven.jar.manifest to specify path to manifest file. Default is $
{basedir}/Manifest.mf (or may be ${basedir}/src/Manifest.mf is better?)
The patch created again maven-1.0-beta-6 distribution.
bash$ diff -rubN maven-1.0-beta-6.orig/plugins/maven-java-plugin-1.0 maven-1.0-beta-6/plugins/maven-java-plugin-1.0
diff -rubN maven-1.0-beta-6.orig/plugins/maven-java-plugin-1.0/plugin.jelly maven-1.0-beta-6/plugins/maven-java-plugin-1
.0/plugin.jelly
— maven-1.0-beta-6.orig/plugins/maven-java-plugin-1.0/plugin.jelly Tue Aug 20 08:31:10 2002
+++ maven-1.0-beta-6/plugins/maven-java-plugin-1.0/plugin.jelly Wed Sep 4 15:45:21 2002
@@ -100,10 +100,23 @@
description="Create the deliverable jar file."
prereqs="test:test">
+ <available property="maven.jar.manifest.available" file="$
{maven.jar.manifest}"/>+
+ <j:choose>
+ <j:when test="${maven.jar.manifest.available}">
+ <echo>Using manifest file ${maven.jar.manifest}
</echo>
+ </j:when>
+ <j:otherwise>
+ <touch file="$
+ <j:set var="maven.jar.manifest" value="${maven.build.dir}
/Manifest.mf" />
+ </j:otherwise>
+ </j:choose>
+
<jar
jarfile="$
/$
{maven.final.name}.jar"
basedir="$
"
- excludes="$
{maven.jar.excludes}">
+ excludes="${maven.jar.excludes}"
{maven.jar.manifest}
+ manifest="$">
<metainf dir="$
{basedir}"><include name="LICENSE.txt"/>
diff -rubN maven-1.0-beta-6.orig/plugins/maven-java-plugin-1.0/plugin.properties maven-1.0-beta-6/plugins/maven-java-plu
gin-1.0/plugin.properties
— maven-1.0-beta-6.orig/plugins/maven-java-plugin-1.0/plugin.properties Thu Jan 1 03:00:00 1970
+++ maven-1.0-beta-6/plugins/maven-java-plugin-1.0/plugin.properties Wed Sep 11 12:16:48 2002
@@ -0,0 +1,5 @@
+# -------------------------------------------------------------------
+# P L U G I N P R O P E R T I E S
+# -------------------------------------------------------------------
+
+maven.jar.manifest = ${basedir}
/Manifest.mf
Alexei,
I'm just trying to understand how the patch keeps existing functionality. It appears from the text that an empty (i.e. touch'ed) file is used if no manifest is specified?