Uploaded image for project: 'Maven Ant Tasks (RETIRED)'
  1. Maven Ant Tasks (RETIRED)
  2. MANTTASKS-219

artifact:dependencies and ant's restrict name resource filtering does not work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.0.10
    • None
    • dependencies task
    • None
    • SUSE Linux Enterprise Server 10 SP1 (x86_64)
      Ant 1.7.0

    Description

      We have an Ant build file which calls maven-ant-tasks's dependencies to copy a bunch of dependencies.
      Since we need to exclude some of those jars, we used Ant's resource selectors to restrict the fileset produced by maven-ant-tasks.

      A small snippet from our build.xml:

      <artifact:pom file="common-core/pom.xml" id="pom.core" />
      <target name="deploy-core-jar" depends="package-core-jar">
      	<artifact:dependencies scopes="compile,runtime" pomrefid="pom.core" filesetid="dependencies.core" />
      	<copy todir="${clientlib.dir}" flatten="true">
      		<restrict>
      			<fileset refid="dependencies.core" />
      			<rsel:not>
      				<rsel:or>
      					<!-- remove maven-ant-tasks and yuicompressor and their dependencies -->
      					<rsel:name name="**/yui*.jar" />
      					<rsel:name name="**/plexus*.jar" />
      					<rsel:name name="**/maven*.jar" />
      					<rsel:name name="**/wagon*.jar" />
      					<rsel:name name="**/ant*.jar" />
      					<rsel:name name="**/classworlds*.jar" />
      					<rsel:name name="**/backport*.jar" />
      				</rsel:or>
      			</rsel:not>
      		</restrict>
      	</copy>
      </target>
      

      But when we ran the target, no files at all were copied. After a long time searching, we stumbled on the fact that it worked when we left out the line

      <rsel:name name="**/maven*.jar" />

      Our local Maven repository was located in /home/user/maven-repository. As it seems the pattern given doesn't respect the standard Ant patterns and also matches the directories in between (as maven* matches maven-repository).

      As a workaround, we renamed the directory containing the Maven repository to something that doesn't match any of the used patterns.

      Attachments

        Activity

          People

            Unassigned Unassigned
            wsymons Wim Symons
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: