felipeal 2004/11/10 19:28:41 Modified: ear plugin.jelly ear/xdocs changes.xml properties.xml Added: ear/src/plugin-test/test02 maven.xml project.xml Log: MPEAR-23: added new property (ear.target.path) that sets where a dependency is located inside the ear Revision Changes Path 1.23 +15 -4 maven-plugins/ear/plugin.jelly Index: plugin.jelly =================================================================== RCS file: /home/cvs/maven-plugins/ear/plugin.jelly,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- plugin.jelly 7 Nov 2004 00:45:00 -0000 1.22 +++ plugin.jelly 11 Nov 2004 03:28:41 -0000 1.23 @@ -85,10 +85,21 @@ </j:if> <ant:echo>Bundling: ${dep.type} - ${dep.id} - ${dep.version}</ant:echo> - <ant:fileset dir="${lib.file.parent}"> - <ant:include name="${lib.file.name}"/> - </ant:fileset> - + <j:set var="targetPath" value="${dep.getProperty('ear.target.path')}"/> + <!-- decide where to include the dependency --> + <j:choose> + <j:when test="${empty(targetPath)}"> + <ant:fileset dir="${lib.file.parent}"> + <ant:include name="${lib.file.name}"/> + </ant:fileset> + </j:when> + <j:otherwise> + <ant:zipfileset dir="${lib.file.parent}" prefix="${targetPath}"> + <ant:include name="${lib.file.name}"/> + </ant:zipfileset> + </j:otherwise> + </j:choose> + </j:if> </j:forEach> 1.1 maven-plugins/ear/src/plugin-test/test02/maven.xml Index: maven.xml =================================================================== <!-- /* * Copyright 2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ --> <project xmlns:j="jelly:core" xmlns:assert="assert" default="testPlugin"> <goal name="testPlugin" prereqs="test-ear"> <attainGoal name="clean"/> </goal> <goal name="test-ear"> <attainGoal name="ear"/> <!-- tests that the ear is generated --> <assert:assertFileExists file="${maven.build.dir}/${maven.final.name}.ear"/> <!-- unzip the ear and look for the jars --> <j:set var="earFile" value="${maven.build.dir}/${maven.final.name}.ear"/> <j:set var="unzipDir" value= "${maven.build.dir}/eartest"/> <mkdir dir="${unzipDir}"/> <unzip src="${earFile}" dest="${unzipDir}"/> <!-- check for commons-logging --> <assert:assertFileExists file="${unzipDir}/APP-INF/lib/commons-logging-1.0.3.jar" msg="commons logging was not bundled"/> <!-- check that commons-collections has not been packaged --> <assert:assertFileNotFound file="${unzipDir}/APP-INF/lib/commons-collections-2.1.jar" msg="commons collections was bundled incorrectly"/> </goal> </project> 1.1 maven-plugins/ear/src/plugin-test/test02/project.xml Index: project.xml =================================================================== <?xml version="1.0" encoding="UTF-8"?> <!-- /* * Copyright 2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ --> <project> <pomVersion>3</pomVersion> <name>Test project for Maven Ear Plugin 02</name> <artifactId>test-maven-ear-plugin-02</artifactId> <organization> <name>Queensland Government</name> <url>www.qld.gov.au</url> </organization> <inceptionYear>2004</inceptionYear> <package>au.gov.qld</package> <shortDescription>Test for Jar paths in Ears</shortDescription> <description>Test that a jar is packaged in the path specified in the project file</description> <url/> <developers> <developer> <name>Wiley Fuller</name> <id>wfuller</id> <email>[EMAIL PROTECTED]</email> <organization>Queensland Government</organization> <role>Java Developer</role> </developer> </developers> <dependencies> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.0.3</version> <url>http://jakarta.apache.org/commons/logging.html</url> <properties> <ear.bundle>true</ear.bundle> <ear.target.path>APP-INF/lib</ear.target.path> </properties> </dependency> </dependencies> <build> <sourceDirectory>${basedir}/src</sourceDirectory> <unitTestSourceDirectory>${basedir}/src/test</unitTestSourceDirectory> </build> </project> 1.24 +1 -0 maven-plugins/ear/xdocs/changes.xml Index: changes.xml =================================================================== RCS file: /home/cvs/maven-plugins/ear/xdocs/changes.xml,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- changes.xml 7 Nov 2004 00:45:00 -0000 1.23 +++ changes.xml 11 Nov 2004 03:28:41 -0000 1.24 @@ -25,6 +25,7 @@ </properties> <body> <release version="1.6-SNAPSHOT" date="in CVS"> + <action dev="felipeal" type="felipeal" issue="MPEAR-23" due-to="Wiley Fuller">Add new property dependency(<code>ear.target.path</code>) to define where a dependency should be added in the EAR.</action> <action dev="felipeal" type="fix" issue="MPEAR-9" due-to="Sean Timm">Build now fails in some cases were the dependencies are copied with wrong case.</action> <action dev="felipeal" type="add" issue="MPEAR-21">Added property <code>maven.ear.appxml.encoding</code>.</action> <action dev="vmassol" type="update" issue="MPEAR-19"> 1.15 +18 -3 maven-plugins/ear/xdocs/properties.xml Index: properties.xml =================================================================== RCS file: /home/cvs/maven-plugins/ear/xdocs/properties.xml,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- properties.xml 15 Oct 2004 05:07:35 -0000 1.14 +++ properties.xml 11 Nov 2004 03:28:41 -0000 1.15 @@ -153,9 +153,9 @@ </properties> </dependency> ]]></source> - + <p> - Those artifact will be also "visible" during generation + Those artifacts will be also "visible" during generation of <code>application.xml</code> file. In case of war artifacts you can also specify context root which will be set in <code>application.xml</code> file: </p> @@ -173,7 +173,22 @@ ]]></source> <p> - Please note that if a jar is a java client module, you will need to declare + Note that by default the artifacts will be bundled in the EAR's root directory. To change the location where an artifact is bundled, please use the <code>ear.target.path</code> property: + </p> + <source><![CDATA[ + <dependency> + <groupId>groupId</groupId> + <artifactId>jarArtifactId</artifactId> + <version>aversion</version> + <type>jar</type> + <properties> + <ear.bundle>true</ear.bundle> + <ear.target.path>APP-INF/lib</ear.target.path> + </properties> + </dependency> + ]]></source> + <p> + Finally, please note that if a jar is a java client module, you will need to declare it using the <code>ear.module</code> property, rather than ear.bundle: </p> <source><![CDATA[
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]