Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My Ant build hangs when I try and resolve dependencies using Ivy

I'm using Ant 1.9 on Mac 10.7.5 and I just installed Ivy. I'm having a problem getting dependencies to download. I have this build.xml file with my Ivy resolve target

<project  xmlns:ivy="antlib:org.apache.ivy.ant" name="hello-ivy" default="run">

    <target name="resolve" description="retrieve dependencies with ivy">
        <ivy:retrieve />
    </target>
    ...
    <target name="createSOAPClientJars" depends="resolve">
        <generateSOAPClientJar serviceName="bsexample"
                      wsdlPath="${bsexample.service.wsdl.url}"/>
    </target>

</project>

Then I have this ivy.xml file at the same level as my build.xml file:

<ivy-module version="2.0">
   <info organisation="org.apache" module="hello-ivy"/>
    <dependencies>
            <dependency org="com.sun.xml.ws" name="jaxws-tools" rev="2.1.4"/>
    </dependencies>
</ivy-module>

But when I run my Ant target, everything just hangs

Daves-MacBook-Pro:antws davea$ ant createSOAPClientJars
Buildfile: /Users/davea/antws/build.xml

resolve:
[ivy:retrieve] :: Apache Ivy 2.3.0 - 20130110142753 :: http://ant.apache.org/ivy/ ::
[ivy:retrieve] :: loading settings :: url = jar:file:/opt/apache-ant-1.9.0/lib/ivy-2.3.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
[ivy:retrieve] :: resolving dependencies :: org.apache#hello-ivy;[email protected]
[ivy:retrieve]  confs: [default]

What am I missing in order to get the dependencies to resolve and kickstart my target?

like image 935
Dave Avatar asked Oct 22 '22 06:10

Dave


2 Answers

It looks like you're using the default ivy settings. This means ivy will attempt to download artifacts from Maven Central (largest repository of open source java software).

If your resolve is hanging it's most likely due the use of a network proxy. Ivy will attempt to connect and eventually time-out. Unfortunately there is an open issue IVY-735 calling for an ability to specify the time-out. I don't know how long ivy waits by default.....

like image 69
Mark O'Connor Avatar answered Oct 27 '22 19:10

Mark O'Connor


I was having a similar issue as describe in Dave's original post. I checked my Internet connection as well as the repository URL listed in ivysettings.xml and everything looked okay.

I was letting the 'ant runtime' command wait in the background while I was looking into why the command didn't seem to resolve to a download URL and in 2 or 3 minutes of waiting, the package downloads started to happen.

I'm not sure, but maybe there is some sort of a default waiting time on the server side when an initial request is received on the maven repository server.

like image 40
groxli Avatar answered Oct 27 '22 18:10

groxli