- Check to make sure maven.ear.src exists before using it.
- Allow resources in the pom for EAR projects - remove debug echos - add a test for resources in the pom git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114909 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
54b32ae119
commit
9cc0520f8e
@ -21,10 +21,11 @@
|
||||
<project
|
||||
xmlns:j="jelly:core"
|
||||
xmlns:ant="jelly:ant"
|
||||
xmlns:artifact="artifact"
|
||||
xmlns:license="license"
|
||||
xmlns:maven="jelly:maven"
|
||||
xmlns:util="jelly:util"
|
||||
xmlns:x="jelly:xml"
|
||||
xmlns:artifact="artifact"
|
||||
>
|
||||
|
||||
<!--==================================================================-->
|
||||
@ -63,9 +64,12 @@
|
||||
<ant:ear destfile="${maven.build.dir}/${maven.final.name}.ear"
|
||||
appxml="${maven.ear.appxml}">
|
||||
|
||||
<fileset dir="${maven.ear.src}" casesensitive="false"
|
||||
excludes="**/META-INF/application.xml"/>
|
||||
|
||||
<!-- include files from maven.ear.src if available -->
|
||||
<util:available file="${maven.ear.src}">
|
||||
<fileset dir="${maven.ear.src}" casesensitive="false"
|
||||
excludes="**/META-INF/application.xml"/>
|
||||
</util:available>
|
||||
|
||||
<!-- include marked dependencies -->
|
||||
<j:forEach var="lib" items="${pom.artifacts}">
|
||||
<j:set var="dep" value="${lib.dependency}"/>
|
||||
@ -111,6 +115,13 @@
|
||||
value="${pom.organization.name}" />
|
||||
</ant:section>
|
||||
</ant:manifest>
|
||||
|
||||
<j:if test="${!pom.build.resources.isEmpty()}">
|
||||
<mkdir dir="${maven.ear.resources}"/>
|
||||
<maven:copy-resources resources="${pom.build.resources}" todir="${maven.ear.resources}"/>
|
||||
<fileset dir="${maven.ear.resources}" />
|
||||
</j:if>
|
||||
|
||||
</ant:ear>
|
||||
|
||||
</goal>
|
||||
|
||||
@ -30,3 +30,4 @@ maven.ear.manifest=${maven.ear.descriptordir}/MANIFEST.MF
|
||||
maven.ear.appxml.generate=false
|
||||
maven.ear.displayname=${pom.id}
|
||||
maven.ear.appxml.version=1.3
|
||||
maven.ear.resources=${maven.build.dir}/ear
|
||||
@ -23,7 +23,7 @@
|
||||
<pomVersion>3</pomVersion>
|
||||
<id>maven-ear-plugin</id>
|
||||
<name>Maven EAR Plugin</name>
|
||||
<currentVersion>1.4</currentVersion>
|
||||
<currentVersion>1.5-SNAPSHOT</currentVersion>
|
||||
<description>Ear Plugin for Maven</description>
|
||||
<shortDescription>Ear Plugin for Maven</shortDescription>
|
||||
<url>http://maven.apache.org/reference/plugins/ear/</url>
|
||||
@ -46,7 +46,7 @@
|
||||
<version>
|
||||
<id>1.2</id>
|
||||
<name>1.2</name>
|
||||
<tag>HEAD</tag>
|
||||
<tag>MAVEN_EAR_1_2</tag>
|
||||
</version>
|
||||
</versions>
|
||||
<developers>
|
||||
|
||||
@ -56,16 +56,21 @@
|
||||
<j:new var="saxReader" className="org.dom4j.io.SAXReader" />
|
||||
<j2ee:resolver var="resolver" />
|
||||
${saxReader.setEntityResolver(resolver)}
|
||||
<echo>${resolver}</echo>
|
||||
<echo>${saxReader.entityResolver}</echo>
|
||||
<x:parse var="applicationDoc" xml="${appXml.toURL()}" SAXReader="${saxReader}" />
|
||||
<x:set var="firstJavaModule" select="string($applicationDoc/application/module/java)"/>
|
||||
<echo>output is ${a}</echo>
|
||||
|
||||
<j:if test="${firstJavaModule != 'commons-collections-2.1.jar'}">
|
||||
<fail>
|
||||
commons-collections-2.1.jar not bundled as a java module found '${firstJavaModule}' instead
|
||||
</fail>
|
||||
</j:if>
|
||||
|
||||
<!-- check for resources -->
|
||||
<j:set var="expectedFile" value="${unzipDir}/resource.txt"/>
|
||||
<u:file var="file" name="${expectedFile}" />
|
||||
<j:if test="${!(file.exists())}">
|
||||
<fail>${expectedFile} not bundled as a resource</fail>
|
||||
</j:if>
|
||||
|
||||
</goal>
|
||||
</project>
|
||||
|
||||
@ -88,5 +88,12 @@
|
||||
<sourceDirectory>src</sourceDirectory>
|
||||
<unitTestSourceDirectory>src/test</unitTestSourceDirectory>
|
||||
<!-- Resources that are packaged up inside the JAR file -->
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/resources</directory>
|
||||
<targetPath></targetPath>
|
||||
<includes><include>*.txt</include></includes>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
1
ear/src/plugin-test/src/resources/resource.txt
Normal file
1
ear/src/plugin-test/src/resources/resource.txt
Normal file
@ -0,0 +1 @@
|
||||
This is a dummy file
|
||||
@ -24,6 +24,12 @@
|
||||
<author email="nathan.coast@blueyonder.co.uk">Nathan Coast</author>
|
||||
</properties>
|
||||
<body>
|
||||
<release version="1.5" date="in CVS">
|
||||
<action dev="dion" type="fix">
|
||||
Check to make sure maven.ear.src exists before using it.
|
||||
</action>
|
||||
<action dev="dion" type="update">Allow resources in EAR projects</action>
|
||||
</release>
|
||||
<release version="1.4" date="2004-03-07">
|
||||
<action dev="dion" type="fix" issue="MPEAR-14">Introduced ear.module property to mark jars as being java client modules</action>
|
||||
<action dev="dion" type="update">Added to the plugin tests a check to make sure the ear includes the jars marked by ear.bundle and ear.module and that ear.module generates a java module in the generated application.xml</action>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user