Fix for MAVEN-458

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114098 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
dion
2003-09-25 08:06:02 +00:00
parent b9ffdd28d4
commit 46dd499c66

View File

@@ -142,20 +142,33 @@
<j:set var="mavenRepoLocal" value='${context.getVariable("maven.repo.local")}'/>
<ant:mkdir dir="${todir}"/>
<ant:copy todir="${todir}" flatten="true">
<ant:fileset dir="${mavenRepoLocal}">
<!-- FIXME: should use pom.artifacts -->
<j:forEach var="dep" items="${pom.dependencies}">
<ant:include name="${dep.artifactDirectory}/${dep.type}s/${dep.artifact}"/>
</j:forEach>
<!-- grab list of excludedItems up front -->
<j:if test="${excludes != ''}">
<!-- The excludes are a list of dep ids -->
<util:tokenize var="excludeItems" delim=",">${excludes}</util:tokenize>
</j:if>
<!--
! for each artifact, see if it is excluded. If not, add a fileset
! to the copy
!-->
<j:forEach var="lib" items="${pom.artifacts}">
<j:set var="excluded" value="false"/>
<j:if test="${excludes != ''}">
<!-- The excludes are a list of dep ids -->
<util:tokenize var="excludeItems" delim=",">${excludes}</util:tokenize>
<!-- The excludes are a list of dep ids, check if this id is in the list -->
<j:forEach var="exclude" items="${excludeItems}">
<j:set var="depToExclude" value="${pom.getDependency(exclude)}"/>
<ant:exclude name="${depToExclude.artifactDirectory}/${depToExclude.type}s/${depToExclude.artifact}"/>
<!-- the exclude could be either the short name (e.g. artifactId), or the id -->
<j:if test="${(lib.dependency.id == exclude) or (lib.dependency.artifactId == exclude)}">
<j:set var="excluded" value="true"/>
</j:if>
</j:forEach>
</j:if>
</ant:fileset>
<j:if test="${!excluded}">
<ant:fileset dir="${lib.file.parent}">
<ant:include name="${lib.file.name}"/>
</ant:fileset>
</j:if>
</j:forEach>
</ant:copy>
</define:tag>