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 08:35:23 UTC
cvs commit: maven-plugins/war plugin.jelly
dion 2004/03/30 22:35:23
Modified: war/src/plugin-test project.xml maven.xml
war/xdocs changes.xml
war plugin.jelly
Log:
Fix for MPWAR-21; Allow generation of the Class-Path manifest entry from dependencies like
the ejb and jar plugins.
Add test for new feature
Revision Changes Path
1.6 +1 -0 maven-plugins/war/src/plugin-test/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/maven-plugins/war/src/plugin-test/project.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- project.xml 4 Mar 2004 18:39:37 -0000 1.5
+++ project.xml 31 Mar 2004 06:35:23 -0000 1.6
@@ -78,6 +78,7 @@
<url>http://jakarta.apache.org/commons/logging.html</url>
<properties>
<war.bundle>true</war.bundle>
+ <war.manifest.classpath>true</war.manifest.classpath>
</properties>
</dependency>
</dependencies>
1.5 +6 -0 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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- maven.xml 31 Mar 2004 04:35:29 -0000 1.4
+++ maven.xml 31 Mar 2004 06:35:23 -0000 1.5
@@ -31,6 +31,7 @@
<assert:assertFileExists file="${warDir}/WEB-INF/lib/commons-logging-1.0.3.jar"/>
<!-- check for manifest contents -->
+ <!-- a) Make sure existing manifest gets merged -->
<j:set var="unzipDir" value="${maven.build.dir}/unzippedWar"/>
<mkdir dir="${unzipDir}"/>
<unzip src="${warFile}" dest="${unzipDir}"/>
@@ -38,6 +39,11 @@
<j:set var="found" value='${manifest.indexOf("Bogus: value") ge 0}'/>
<j:if test="${!found}">
<fail>Manifest not merged</fail>
+ </j:if>
+ <!-- b) Make sure Class-Path entry is created -->
+ <j:set var="found" value='${manifest.indexOf("Class-Path: commons-logging-1.0.3.jar") ge 0}'/>
+ <j:if test="${!found}">
+ <fail>Class-Path not generated</fail>
</j:if>
</goal>
</project>
1.21 +1 -0 maven-plugins/war/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/maven-plugins/war/xdocs/changes.xml,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- changes.xml 31 Mar 2004 04:35:30 -0000 1.20
+++ changes.xml 31 Mar 2004 06:35:23 -0000 1.21
@@ -25,6 +25,7 @@
</properties>
<body>
<release version="1.6" date="in CVS">
+ <action dev="dion" type="update" issue="MPWAR-21">Allow automated generation of manifest Class-Path</action>
<action dev="dion" type="update" issue="MPWAR-22">Allow customizing of MANIFEST.MF</action>
</release>
1.38 +13 -0 maven-plugins/war/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/maven-plugins/war/plugin.jelly,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- plugin.jelly 31 Mar 2004 04:35:30 -0000 1.37
+++ plugin.jelly 31 Mar 2004 06:35:23 -0000 1.38
@@ -56,6 +56,14 @@
<ant:echo>Building WAR ${pom.artifactId}</ant:echo>
+ <!-- build dependency list -->
+ <j:set var="maven.war.classpath" value=""/>
+ <j:forEach var="dep" items="${pom.dependencies}">
+ <j:if test="${dep.getProperty('war.manifest.classpath')=='true'}">
+ <j:set var="maven.war.classpath" value="${maven.war.classpath} ${dep.artifact}"/>
+ </j:if>
+ </j:forEach>
+
<ant:available property="maven.war.manifest.available"
file="${maven.war.manifest}"/>
@@ -74,6 +82,11 @@
</j:if>
<ant:manifest>
+ <j:set var="classPath" value="${maven.war.classpath}"/>
+ <j:if test="${!empty(classPath)}">
+ <ant:attribute name="Class-Path" value="${maven.war.classpath}"/>
+ </j:if>
+
<ant:attribute name="Built-By" value="${user.name}" />
<ant:section name="${pom.package}">
<ant:attribute name="Specification-Title" value="${pom.artifactId}" />
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org