maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Chamberlain" <richard.chamberl...@caplin.com>
Subject Maven ant tasks: Getting artefacts based on type
Date Fri, 08 Jan 2010 15:20:25 GMT
Hi,

 

I'm using maven ant tasks as i'm doing a non-java build, but want to use
the power of dependencies.

 

I'm trying to get all the dependencies of type "zip" into a fileset.

 

Here is the POM:

 

<?xml version="1.0"?>

<project>

  <modelVersion>4.0.0</modelVersion>

  <groupId>xxxx</groupId>

  <artifactId>xxxxxxxx</artifactId>

  <version>1.0-SNAPSHOT</version>

  <packaging>zip</packaging>

 

  <dependencies>

                <dependency>

      <groupId>group</groupId>

      <artifactId>jarartefact</artifactId>

      <version>1.0-SNAPSHOT</version>

      <type>jar</type>

 </dependency>

 

                <dependency>

      <groupId>group</groupId>

      <artifactId>zipartefact</artifactId>

      <version>1.0-SNAPSHOT</version>

      <type>zip</type>

 </dependency>

</dependencies>

 

The ant task is:

                <target name="build">

                                <artifact:pom id="maven.profiled.pom"
file="pom.xml" />

                                <artifact:dependencies
pathId="maven.dependencies.id" type="zip">

                                                <pom
refid="maven.profiled.pom" />

                                </artifact:dependencies>

                                <property name="maven.dependencies"
refid="maven.dependencies.id"/>

                                <echo message="Zip dependencies:
${maven.dependencies}" />

                                

                                <artifact:dependencies
pathId="maven.dependencies.jar.id" type="jar">

                                                <pom
refid="maven.profiled.pom" />

                                </artifact:dependencies>

                                <property name="maven.dependencies.jar"
refid="maven.dependencies.jar.id"/>

                                <echo message=" Jar dependencies:
${maven.dependencies.jar}" />

                </target>

 

I would expect both that jar and zip dependency to be printed out.
However it prints out nothing for the jar, but prints out the zip.

If I change the project packaging to jar, it prints out the jar, but not
the zip.

It seems as though the dependency mechanism takes into account the
packaging of the project before looking into dependencies. 

 

Is this the way it is supposed to work? Or am I using it wrong? How do I
get a filtered list of dependencies using ant tasks?

 

Thanks for your help,

 

Richard

  

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message