MPANT-7. Not obeying jar overrides. While this patch doesn't get every case, it does

get the common one of using an included lib.  I am using this succesfuly with commons-email's
ant build.


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@116257 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
epugh
2004-11-23 17:14:26 +00:00
parent ccc462de40
commit 40b4ade85a
7 changed files with 37 additions and 4 deletions

View File

@@ -23,7 +23,7 @@
<pomVersion>3</pomVersion>
<id>maven-ant-plugin</id>
<name>Maven Ant Plugin</name>
<currentVersion>1.8.1</currentVersion>
<currentVersion>1.9-SNAPSHOT</currentVersion>
<description>Generates ant build files from a maven project, so that plain ant users can build your project</description>
<shortDescription>Generate Ant build file</shortDescription>
<url>http://maven.apache.org/reference/plugins/ant/</url>

View File

@@ -349,14 +349,26 @@
proxyuser="${maven.proxy.username}"
proxypassword="${maven.proxy.password}"/>
<j:forEach var="dep" items="${pom.dependencies}">
<!-- note: this is a valid use of artifactDirectory -->
<j:forEach var="lib" items="${pom.artifacts}">
<maven:makeRelativePath var="relativePath" basedir="${maven.repo.local}" path="${lib.path}" separator="/"/>
<u:file var="checkExist" name="${maven.repo.local}/${relativePath}" />
<j:choose>
<j:when test="${checkExist.exists()}">
<j:set var="dep" value="${lib.dependency}"/>
<!-- note: this is a valid use of artifactDirectory -->
<get
src="${repo}/${dep.artifactDirectory}/${dep.type}s/${dep.artifact}"
dest="$${libdir}/${dep.artifact}"
usetimestamp="true"
ignoreerrors="true"
/></j:forEach>
/>
</j:when>
<j:otherwise>
<maven:makeRelativePath var="relativePath" basedir="${basedir}" path="${lib.path}" separator="/"/>
<copy todir="$${libdir}" file="${relativePath}"/>
</j:otherwise>
</j:choose>
</j:forEach>
</target>
<!-- ================================================================== -->

Binary file not shown.

View File

@@ -47,6 +47,12 @@
<assert:assertEquals expected="target" value="${defaulttargetdirValue}"
msg="defaulttargetdir property is not relative"/>
<!-- check obey jar override -->
<x:set var="countJarsDownload" select="count($buildXml/project/target[@name = 'get-deps']/get)"/>
<assert:assertEquals expected="1" value="${countJarsDownload.intValue().toString()}" msg="Should only download JUnit jar"/>
<x:set var="countJarsCopy" select="count($buildXml/project/target[@name = 'get-deps']/copy)"/>
<assert:assertEquals expected="1" value="${countJarsDownload.intValue().toString()}" msg="Should only copy the activation jar"/>
<!-- check test filesets -->
<x:set var="testFilesetDirs" select="$buildXml/project/target[@name = 'compile-tests']/copy/fileset/@dir"/>
<assert:assertEquals expected="src/test" value="${testFilesetDirs[0].value}"

View File

@@ -0,0 +1,2 @@
maven.jar.override=on
maven.jar.activation = ${basedir}/lib/activation-1.0.2.jar

View File

@@ -53,6 +53,15 @@
</developers>
<dependencies>
<!-- Used in testing maven.jar.override -->
<dependency>
<groupId>activation</groupId>
<artifactId>activation</artifactId>
<version>1.0.2</version>
<type>jar</type>
<properties/>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>

View File

@@ -24,6 +24,10 @@
<author email="dion@multitask.com.au">dIon Gillard</author>
</properties>
<body>
<release version="1.9" date="">
<action dev="epugh" type="add" issue="MPANT-7">Obey jar override and not attempt to download relative jars.</action>
</release>
<release version="1.8.1" date="2004-08-20">
<action dev="carlos" type="fix" issue="MPANT-16">Use relative paths in test resources filesets.</action>
</release>