On 3/31/07, Jing Xue <[EMAIL PROTECTED]> wrote:

Hi,

I'm new to ivy, and just started playing around with this simple ivy
dependencies,

  <dependencies>
    <dependency org="log4j" name="log4j" rev="1.2.+"></dependency>
    <dependency org="org.springframework" name="spring" rev="2.0.3
"></dependency>
  </dependencies>

with this ivy conf:
  <conf defaultResolver="main" checkUpToDate="false" />
    <resolvers>
       <chain name="main" >
         <ivyrep name="ivyrep" />
         <ibiblio name="ibiblio" m2compatible="true" />
       </chain>
    </resolvers>
  </conf>

The problem I'm having is when I run it, ivy appears to start
downloading _all_ the spring dependencies defined in the maven2 repo,
even those that are optional according to spring's pom. And those
optional dependencies would trigger more transitive dependencies. I had
to kill the process because it almost looked like trying to mirrow the
whole maven2 repo. 8-)


The problem is that if you don't specify any conf, Ivy assumes you want all
the configurations of spring, which includes the optional conf. Try that
instead:
<dependency org="org.springframework" name="spring" rev="2.0.3"
conf="*->default"/>

The *-> default means that all your module configurations depend on the
'default' configuration of spring.


The workaround I found out is to add transitive="false" to the spring
dependency above. But that obviously turns off the non-optional
dependencies as well. So I wonder whether there is any better way to
deal with it.

Thanks for any pointers.

We should write documentation on that, we have no doc explaining how pom are
converted to ivy module descriptors, so it's difficult to guess which
configurations are available :-) Could you open a bug in JIRA on the
documentation component, asking for such a doc?

- Xavier

--
Learn Ivy at ApacheCon: http://www.eu.apachecon.com/
Manage your dependencies with Ivy!
http://incubator.apache.org/ivy/

Reply via email to