Ivy failed to resolve dependency : What to check, what to do?
I'm using Ivy to resolve dependency in my very small project. It's the first time I'm doing that and it's more to learn as my project is very small.
I had a problem 5 minutes ago, when trying to download log4j.
开发者_StackOverflow社区My configuration is very basic, I have an ant task :
<target name="resolve" description="--> retrieve dependencies with ivy">
<ivy:retrieve/>
</target>
and my Ivy.xml file is like this :
<dependency org="javax.servlet" name="servlet-api" rev="2.5" />
<dependency org="log4j" name="log4j" rev="1.2.15" />
</dependencies>
The problem is seems to happen when ivy tries to download jms 1.1 (I suppose it's needed for log4j) as I can see in the console :
:
:::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve] :: FAILED DOWNLOADS ::
[ivy:retrieve] :: ^ see resolution messages for details ^ ::
[ivy:retrieve] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve] :: javax.jms#jms;1.1!jms.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] ::::::::::::::::::::::::::::::::::::::::::::::
Is there anything I can do ?
Thanks a lot guys.
F
The problem is, as you have realised, that those jars are not in the remote repositories. But they might not really be required for your program. The only reason Ivy tries to download them is because they are declared in the pom.xml on ibiblio. If you try version 1.2.14 you will see that these transitive dependencies are not in the 1.2.14 pom, and so Ivy won't download them.
Alternatively, if you wish to stick with 1.2.15, you can add an exclude element to your ivy.xml file to tell Ivy to ignore those libraries:
<dependency org="log4j" name="log4j" rev="1.2.15">
<exclude org="com.sun.jdmk"/>
<exclude org="com.sun.jmx"/>
<exclude org="javax.jms"/>
</dependency>
Hope that helps :)
精彩评论