[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ivy-user
Subject:    Ivy transitive dependencies question
From:       Ian Hlavats <ian () tarantulaconsulting ! com>
Date:       2011-09-26 4:25:51
Message-ID: 32503927.post () talk ! nabble ! com
[Download RAW message or body]


Hello, 

I am trying to run a Java application using Ant and Ivy as follows: 

build.xml 

<project ...> 

   <target name="run"> 
      <ivy:configure file="./ivy-settings.xml" /> 
      <ivy:resolve conf="default" />     
      <ivy:cachepath conf="default" pathId="run.classpath" /> 
      <java classname="Foo" ... /> 
   </target> 

</project> 

In my application I have the following modules: 

Module A (ivy.xml) 

  <dependencies> 
    <dependency org="myorg" name="module-B" transitive="true"  /> 
  </dependencies> 

Module B (ivy.xml) 

  <dependencies> 
    <dependency org="commons-lang" name="commons-lang" rev="2.4"
transitive="false" /> 
    <dependency org="org.springframework" name="spring-beans"
rev="3.0.6.RELEASE" transitive="false" conf="*->master" /> 
    ... 
  </dependencies> 

When I try to run the application with "ant run", I am expecting Ivy to add
the following jars to the classpath: 

module-B.jar 
commons-lang-2.4.jar 
spring-beans-3.0.6.RELEASE.jar 

However, apparently Ivy is trying to include the above 3 dependencies as
well as all the dependencies of the spring-beans module. The list of
transitive dependencies is extensive and trying to resolve all of these adds
a lot of unnecessary overhead to my build process. Also, my run target is
failing because I do not have all the necessary dependencies for compiling
Spring, and I don't plan to because I am not compiling Spring but only
relying on a small subset of its dependencies. 

What appears to be happening is that for any dependencies of my top-level
module that have transitive="true", Ivy is including all dependencies
transitively regardless of the transitive attribute of dependencies in the
dependent module's ivy.xml file. It seems that Ivy is undesirably ignoring
or overriding my transitive attributes for dependencies of dependent modules
(i.e. "sub-dependencies"). 

I do not want to include those dependencies on my classpath, and I do not
want Ivy to try to resolve them. I want Ivy to include any immediate
dependencies of the module I am trying to run. I want Ivy to include
transitive dependencies only if these dependencies that have
transitive="true". 

For example: 

Module A depends on Module B (transitive = true) 
  Module B depends on Module C (transitive = false), Module D (transitive =
true) 
    Module C depends on Module E, Module F 
    Module D depends on Module G, Module H 

If I call <ivy:cachepath> for Module A, I would like the following
dependencies to be added to the path: 

Module B 
Module C 
Module D 
Module G 
Module H 

Would someone please let me know if/how this can be accomplished? 

Many thanks.
-- 
View this message in context: \
http://old.nabble.com/Ivy-transitive-dependencies-question-tp32503927p32503927.html \
Sent from the ivy-user mailing list archive at Nabble.com.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic