You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Thomas Göttlich <gu...@googlemail.com> on 2010/07/07 16:03:36 UTC

Partial transitive retrieve

Hi, I have a question on the ivy:retrieve task:

We are building an enterprise application which consists of multiple
modules.
Each module has several dependencies, among which are some which only are
required for compilation.

The EAR has dependencies on our modules in order to put them into the lib
dir.

We now have several Ivy configurations:

dep-for-ear -> dependency for the ear, i.e. artifacts of type "ejb" are put
into the top level and artifacts of type "jar" are put into the "lib"
directory.
provided -> dependency which is needed at compile time only and is provided
by the application server (JBoss in our case)


I now want to retrieve all direct and transitive dependencies which need to
be put into the ear/lib directory:

<ivy:retrieve sync="true" conf="dep-for-ear" type="jar"
pattern="${ear.dir}/lib/[artifact]-[revision].[ext]" />

However, I also get the "provided" transitive dependencies.
The output indicates they are resolved as "dep-for-ear".

Example:

In our EAR-project's ivy.xml, we have this dependency definition:

<dependencies defaultconfmapping="*->*,!sources,!javadoc">
    ...
    <dependency org="my.org" name="my-ejb-project" rev="latest.integration"
conf="dep-for-ear" />
    ...
</dependencies>


In the ivy.xml of the my-ejb-project module, some JBoss artifacts are
declared as "provided", others are declared as "dep-for-ear":

<dependencies defaultconfmapping="*->*,!sources,!javadoc">
   ...
   <dependency org="my.org" name="my-api-project" rev="latest.integration"
conf="dep-for-ear"/>
   ...
   <dependency org="jboss" name="jboss-annotations-ejb3" rev="4.2.3.GA"
conf="provided"/>
   <dependency org="jboss" name="jboss-ejb3x" rev="4.2.3.GA"
conf="provided"/>
   <dependency org="jboss" name="jboss-ejb3" rev="4.2.3.GA"
conf="provided"/>
   <dependency org="jboss" name="jboss-j2ee" rev="4.2.3.GA"
conf="provided"/>
   ...
</dependencies>


When retrieving the "dep-for-ear" dependencies, I'd expect that
only*my-api-project
* would be copied to the ear/lib dir, since *my-ejb-project* is of type ejb.

However, I also get the JBoss libs.


Any idea of what is missing or wrong?

Thanks in advance for your help.