fix for MPEAR-27: using lib.name instead of lib.file.name as the name of the dependency (so it uses the right name when maven.jar.overrides is set to true

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@116238 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
felipeal
2004-11-16 06:01:44 +00:00
parent 8fefd27e7a
commit 0b170a8106
5 changed files with 109 additions and 1 deletions

View File

@@ -106,7 +106,7 @@
<!-- define the name of the dependency -->
<j:set var="bundleName" value="${dep.getProperty('ear.bundle.name')}"/>
<j:if test="${empty(bundleName)}">
<j:set var="bundleName" value="${lib.file.name}"/>
<j:set var="bundleName" value="${lib.name}"/>
</j:if>
<j:set var="bundlePath" value="${bundleDir}/${bundleName}"/>

View File

@@ -0,0 +1,44 @@
<!--
/*
* Copyright 2001-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:assert="assert"
xmlns:util="jelly:util"
xmlns:j="jelly:core"
xmlns:ant="jelly:ant"
default="testPlugin">
<goal name="testPlugin" prereqs="test-ear">
<attainGoal name="clean"/>
</goal>
<goal name="test-ear" prereqs="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}/fakeSar-1.0.sar"
msg="fakeSar-1.0.sar was not bundled"/>
</goal>
</project>

View File

@@ -0,0 +1,17 @@
# -------------------------------------------------------------------
# Copyright 2001-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.
# -------------------------------------------------------------------
maven.jar.override=on
maven.jar.fakeSar=project.xml

View File

@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
* Copyright 2001-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 06</name>
<artifactId>test-maven-ear-plugin-06</artifactId>
<inceptionYear>2004</inceptionYear>
<shortDescription>Makes sure a SAR dependency is bundled</shortDescription>
<description>Makes sure a SAR dependency is bundled (see issues MPEAR-3 and MPEAR-10)</description>
<url/>
<developers>
<developer>
<name>Felipe Leme</name>
<id>felipeal</id>
<role>Jelly Developer</role>
</developer>
</developers>
<dependencies>
<dependency>
<groupId>${pom.groupId}</groupId>
<artifactId>fakeSar</artifactId>
<version>1.0</version>
<type>sar</type>
<properties>
<ear.bundle>true</ear.bundle>
</properties>
</dependency>
</dependencies>
</project>

View File

@@ -25,6 +25,7 @@
</properties>
<body>
<release version="1.6-SNAPSHOT" date="in CVS">
<action dev="felipeal" type="fix" issue="MPEAR-27">Fixed the name of the bundled dependency when <code>maven.jar.overrides</code> is used.</action>
<action dev="felipeal" type="fix" issue="MPEAR-24">Properties <code>maven.ear.src</code> and <code>maven.ear.resources</code> now cannot have the same value.</action>
<action dev="felipeal" type="fix" issue="MPEAR-7"><code>application.xml</code> is now generated at <code>maven.build.dir</code></action>
<action dev="felipeal" type="add" issue="MPEAR-26">Add new property dependency (<code>ear.bundle.name</code>) to define the name a dependency should have the EAR.</action>