You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by di...@apache.org on 2004/03/31 06:35:30 UTC
cvs commit: maven-plugins/war plugin.properties project.xml plugin.jelly
dion 2004/03/30 20:35:30
Modified: war/src/plugin-test maven.xml
war/xdocs properties.xml changes.xml
war plugin.properties project.xml plugin.jelly
Added: war/src/plugin-test project.properties
war/src/plugin-test/src MANIFEST.MF
Log:
Allow customizing of MANIFEST.MF.
Add test cases for the customization
Revision Changes Path
1.4 +15 -14 maven-plugins/war/src/plugin-test/maven.xml
Index: maven.xml
===================================================================
RCS file: /home/cvs/maven-plugins/war/src/plugin-test/maven.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- maven.xml 4 Mar 2004 18:39:37 -0000 1.3
+++ maven.xml 31 Mar 2004 04:35:29 -0000 1.4
@@ -15,7 +15,9 @@
* limitations under the License.
*/
-->
-<project xmlns:j="jelly:core" xmlns:u="jelly:util">
+<project xmlns:j="jelly:core"
+ xmlns:assert="assert"
+ xmlns:u="jelly:util">
<goal name="testPlugin" prereqs="test-war">
<attainGoal name="clean"/>
@@ -23,20 +25,19 @@
<goal name="test-war">
<attainGoal name="war"/>
+ <j:set var="warFile" value="${maven.build.dir}/test-maven-war-plugin.war"/>
+ <j:set var="warDir" value="${maven.build.dir}/test-maven-war-plugin"/>
+ <assert:assertFileExists file="${warFile}"/>
+ <assert:assertFileExists file="${warDir}/WEB-INF/lib/commons-logging-1.0.3.jar"/>
- <j:set var="expectedFile"
- value="${maven.build.dir}/test-maven-war-plugin.war"/>
- <u:file var="file" name="${expectedFile}" />
- <j:if test="${!(file.exists())}">
- <fail>${expectedFile} not generated</fail>
+ <!-- check for manifest contents -->
+ <j:set var="unzipDir" value="${maven.build.dir}/unzippedWar"/>
+ <mkdir dir="${unzipDir}"/>
+ <unzip src="${warFile}" dest="${unzipDir}"/>
+ <u:loadText var="manifest" file="${unzipDir}/META-INF/MANIFEST.MF"/>
+ <j:set var="found" value='${manifest.indexOf("Bogus: value") ge 0}'/>
+ <j:if test="${!found}">
+ <fail>Manifest not merged</fail>
</j:if>
-
- <j:set var="expectedFile"
- value="${maven.build.dir}/test-maven-war-plugin/WEB-INF/lib/commons-logging-1.0.3.jar"/>
- <u:file var="file" name="${expectedFile}" />
- <j:if test="${!(file.exists())}">
- <fail>${expectedFile} not generated</fail>
- </j:if>
-
</goal>
</project>
1.1 maven-plugins/war/src/plugin-test/project.properties
Index: project.properties
===================================================================
maven.war.manifest=${basedir}/src/MANIFEST.MF
1.10 +8 -0 maven-plugins/war/xdocs/properties.xml
Index: properties.xml
===================================================================
RCS file: /home/cvs/maven-plugins/war/xdocs/properties.xml,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- properties.xml 4 Mar 2004 18:39:37 -0000 1.9
+++ properties.xml 31 Mar 2004 04:35:29 -0000 1.10
@@ -113,6 +113,14 @@
</td>
</tr>
<tr>
+ <td>maven.war.manifest</td>
+ <td>Yes</td>
+ <td>
+ Location of the MANIFEST.MF file in the source tree. It defaults to
+ <code>${pom.build.sourceDirectory}/META-INF/MANIFEST.MF</code>.
+ </td>
+ </tr>
+ <tr>
<td>maven.war.index</td>
<td>Yes</td>
<td>
1.20 +4 -0 maven-plugins/war/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/maven-plugins/war/xdocs/changes.xml,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- changes.xml 7 Mar 2004 01:20:41 -0000 1.19
+++ changes.xml 31 Mar 2004 04:35:30 -0000 1.20
@@ -24,6 +24,10 @@
<author email="vmassol@apache.org">Vincent Massol</author>
</properties>
<body>
+ <release version="1.6" date="in CVS">
+ <action dev="dion" type="update" issue="MPWAR-22">Allow customizing of MANIFEST.MF</action>
+ </release>
+
<release version="1.5" date="2004-03-07">
<action dev="dion" type="fix">Fix for MAVEN-986. Allow resources to be copied when no sources present</action>
<action dev="vmassol" type="add">Use the new
1.1 maven-plugins/war/src/plugin-test/src/MANIFEST.MF
Index: MANIFEST.MF
===================================================================
Bogus: value
1.10 +2 -0 maven-plugins/war/plugin.properties
Index: plugin.properties
===================================================================
RCS file: /home/cvs/maven-plugins/war/plugin.properties,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- plugin.properties 4 Mar 2004 18:39:37 -0000 1.9
+++ plugin.properties 31 Mar 2004 04:35:30 -0000 1.10
@@ -40,3 +40,5 @@
# ${maven.war.build.dir}/${pom.artifactId}
maven.war.webapp.dir = ${maven.war.build.dir}/${pom.artifactId}
maven.war.tld.dir=WEB-INF/tld
+
+maven.jar.manifest=${pom.build.sourceDirectory}/META-INF/MANIFEST.MF
\ No newline at end of file
1.21 +1 -1 maven-plugins/war/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/maven-plugins/war/project.xml,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- project.xml 7 Mar 2004 01:20:41 -0000 1.20
+++ project.xml 31 Mar 2004 04:35:30 -0000 1.21
@@ -23,7 +23,7 @@
<pomVersion>3</pomVersion>
<id>maven-war-plugin</id>
<name>Maven WAR Plugin</name>
- <currentVersion>1.5</currentVersion>
+ <currentVersion>1.6-SNAPSHOT</currentVersion>
<description>War Plugin for Maven</description>
<shortDescription>War Plugin for Maven</shortDescription>
<url>http://maven.apache.org/reference/plugins/war/</url>
1.37 +7 -0 maven-plugins/war/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/maven-plugins/war/plugin.jelly,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- plugin.jelly 4 Mar 2004 18:39:37 -0000 1.36
+++ plugin.jelly 31 Mar 2004 04:35:30 -0000 1.37
@@ -56,6 +56,9 @@
<ant:echo>Building WAR ${pom.artifactId}</ant:echo>
+ <ant:available property="maven.war.manifest.available"
+ file="${maven.war.manifest}"/>
+
<ant:mkdir dir="${maven.war.build.dir}" />
<ant:jar
destfile="${maven.war.build.dir}/${maven.war.final.name}"
@@ -65,6 +68,10 @@
<ant:metainf dir="${licenseFile.canonicalFile.parent}">
<ant:include name="${licenseFile.canonicalFile.name}"/>
</ant:metainf>
+
+ <j:if test="${maven.war.manifest.available}">
+ <ant:setProperty name="manifest" value="${maven.war.manifest}" />
+ </j:if>
<ant:manifest>
<ant:attribute name="Built-By" value="${user.name}" />
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org