ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kirby Files <kfi...@masergy.com>
Subject Re: Configurations and Ivy file confusion
Date Wed, 22 Apr 2009 15:36:34 GMT
Tom wrote on 04/22/2009 10:41 AM:
> I also have the problem that it is not working as expected. Using the
> following ivy.xml:
>
> <dependencies>
> <dependency org="org.codehaus.enunciate" name="enunciate-rt"
> rev="1.10"/> <dependency org="org.codehaus.enunciate"
> name="enunciate-core" rev="1.10" /> <!-- also contains the ant task -->
> <dependency org="junit" name="junit" rev="4.5"/> <dependency
> org="org.liquibase" name="liquibase-core" rev="1.9.2"/> </dependencies>
> </ivy-module>

In this case, you're relying on Ivy's default configuration mapping, 
which I believe is "*->*", which means you'll get all of the artifacts 
(jars) defined by *any* of the dependency's configurations.

> /And the running "<ivy:retrieve/>" results in 93 jars being downloaded,
> amongst which are "activation-1.1.jar" and "jaxb-api-2.1.jar". Now, I
> wanted to split these up according to usage:
>
> <dependencies>
> <dependency org="org.codehaus.enunciate" name="enunciate-rt" rev="1.10"
> conf="runtime->default"/> <dependency org="org.codehaus.enunciate"
> name="enunciate-core" rev="1.10" conf="build->default"/>
> <dependency org="junit" name="junit" rev="4.5" conf="test->default"/>
> <dependency org="org.liquibase" name="liquibase-core" rev="1.9.2"
> conf="test->default"/> </dependencies>
> </ivy-module>

Now you have limited the artifacts to those defined by the "default" 
configuration of each dependency. That probably doesn't include jars 
from configs like "test", "sources", etc.

> Instead of 93 now 78 jars are being downloaded and a.o.
> "activation-1.1.jar" and "jaxb-api-2.1.jar" are missing. I do not
> understand! The same happens if I just do a "<ivy:retrieve/>": 78 jars.
> Same dependencies... One of these dependency must be referring to the
> missing jars. How can they be missing?

Configuration mapping has been the most confusing part of Ivy for me. 
I still haven't mastered the use of it to come up with a best 
practices within our organization. If you generally are using projects 
found on the ibiblio Maven2 repo, you should get familiar with the 
default configurations which Maven defines. You can use 
defaultconfmapping to expand or limit the artifacts for all of your 
configurations:

     <dependencies 
defaultconfmapping="build->default,test;deploy->default">

Thanks,
   --kirby


Mime
View raw message