Question

I have been looking at and playing around with IVY of late for a new project. I know that there are two camps on this topic and a lot of reasons people choose one or the other. This question is not focused on that.

What I am interested in is when I use IVY to say get the Spring Frame using the Maven 2 repository I get a Ton of Jar files and then there are issues finding the right version and I have to exclude items etc. Now, if I turn off Poms then I only get the spring framework jar and everything works.

Is there a reason why so many Jar files are delivered through the use of POMs - do these same number of Jar files come if you use a pure Maven solution?


@Pascal_Thivent Here is an update to what I mean.

This is the output that I am getting:

[ivy:retrieve]      ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]      ::          UNRESOLVED DEPENDENCIES         ::
[ivy:retrieve]      ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]      :: javax.ejb#ejb;3.0: not found
[ivy:retrieve]      :: com.oracle#toplink-essentials;2.41: not found
[ivy:retrieve]      :: com.oracle#oc4j;1.0: not found
[ivy:retrieve]      :: jexcelapi#jxl;2.6.6: not found
[ivy:retrieve]      ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve] 
[ivy:retrieve]      ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]      ::              FAILED DOWNLOADS            ::
[ivy:retrieve]      :: ^ see resolution messages for details  ^ ::
[ivy:retrieve]      ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]      :: javax.faces#jsf-api;1.1!jsf-api.jar
[ivy:retrieve]      :: com.bea.wlplatform#commonj-twm;1.1!commonj-twm.jar
[ivy:retrieve]      :: com.oracle.toplink#toplink;10.1.3!toplink.jar
[ivy:retrieve]      :: com.sun.jdmk#jmxtools;1.2.1!jmxtools.jar
[ivy:retrieve]      :: com.sun.jmx#jmxri;1.2.1!jmxri.jar
[ivy:retrieve]      ::::::::::::::::::::::::::::::::::::::::::::::

Here is my ivy.xml

    <dependencies>
    <dependency org="jstl" name="jstl" rev="1.1.2"/>
    <dependency org="commons-logging" name="commons-logging" rev="1.1.1" >
        <exclude org="com.sun.jdmk"/>
        <exclude org="com.sun.jmx"/>
        <exclude org="javax.jms"/>
    </dependency>
    <dependency org="commons-lang" name="commons-lang" rev="2.5">
        <exclude org="com.sun.jdmk"/>
        <exclude org="com.sun.jmx"/>
        <exclude org="javax.jms"/>
    </dependency>
    <dependency org="org.springframework" name="spring" rev="2.5.6"/>
    <dependency org="org.springframework" name="spring-webmvc" rev="2.5.6"/>

</dependencies>

Here is my ivy settings

<ivysettings>
<settings defaultResolver="myChain" />
<resolvers>
    <url name="com.springsource.repository.bundles.release">
        <ivy pattern="http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
        <artifact pattern="http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
    </url>
    <url name="com.springsource.repository.bundles.external">
        <ivy pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
        <artifact pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
    </url>

    <chain name="myChain">

        <resolver ref="com.springsource.repository.bundles.release" />
        <resolver ref="com.springsource.repository.bundles.external"/>
        <ibiblio name="jboss" m2compatible="true" root="http://repository.jboss.org/maven2" checkconsistency="false"/>
        <ibiblio name="libraries" m2compatible="true" checkconsistency="false"/>
        <ibiblio name="ilibraries-mirror" m2compatible="true" root="http://mirrors.ibiblio.org/pub/mirrors/maven2/" checkconsistency="false"/>
        <ibiblio name="sun" m2compatible="true" root="http://download.java.net/maven/2/" checkconsistency="false"/>
    </chain>
</resolvers>

Was it helpful?

Solution

This is a bit a shot in the dark (I don't know what "turn off POMs" means) but my guess is that you are actually getting transitive dependencies (this is simplified but, if A depends on B and if you declare a dependency on A, you'll also get B).

That's one of the features you get when using Maven dependencies and their metadata (the POMs) and a Dependency Management solution like Maven or Ivy. This is a default behavior with Maven and it can't be disabled (there is a meta issue about this, MNG-1977). With Ivy, it looks like it's possible, e.g.:

<dependencies>  
   <dependency org="org.hibernate" name="hibernate-core"
               rev="3.3.1.GA" conf='..'
               transitive="false" /> 
</dependencies>

Is this what you meant?

See also

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top