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 git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114961 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -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}" />
|
||||
|
||||
@@ -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}"/>
|
||||
@@ -39,5 +40,10 @@
|
||||
<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>
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user