Allow customizing of MANIFEST.MF.
Add test cases for the customization git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114957 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
1 parent
96cb1d5a48
commit
c9f3ef25d4
8 files changed
+39
-15
No files matched your search
@@ -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>
|
||||
@@ -0,0 +1 @@
|
||||
maven.war.manifest=${basedir}/src/MANIFEST.MF
|
||||
@@ -0,0 +1 @@
|
||||
Bogus: value
|
||||
Reference in new issue
Block a user