1
votes

I am trying to download Spring Batch and Spring Framework using Ivy, and I'm not getting very far.

Dependencies in ivy.xml:

<dependency org="org.springframework.batch" name="org.springframework.batch.core" rev="2.1.6.RELEASE" />
<dependency org="org.springframework" name="org.springframework.spring-library" rev="3.0.6.RELEASE" />

ivysettings.xml:

<ivysettings>
<settings defaultResolver="chained"/>
<resolvers>
    <chain name="chained">
        <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>
</resolvers>
</ivysettings>

build.xml:

...
<ivy:settings file="ivysettings.xml"/>
...
<target name="resolve" description="retrieve dependencies with ivy">
    <ivy:retrieve/>
</target>    

When I run ant resolve I get the following:

[ivy:retrieve]      ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]      ::          UNRESOLVED DEPENDENCIES         ::
[ivy:retrieve]      ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]      :: org.springframework#org.springframework.spring-library;3.0.6.RELEASE: not found
[ivy:retrieve]      ::::::::::::::::::::::::::::::::::::::::::::::

What am I doing wrong? I've used this page for getting the configuration.

1

1 Answers

1
votes

Spring libraries are now published via Maven Central. This means they can be found using the Maven search website:

This means you need to declare your dependencies as follows:

<dependency org="org.springframework.batch" name="spring-batch-core" rev="2.1.8.RELEASE"/>
<dependency org="org.springframework" name="spring-core" rev="3.0.6.RELEASE"/>

A settings file now becomes optional (Maven Central is an ivy default).

If you want to create one, use the following:

<ivysettings>
    <settings defaultResolver="central"/>
    <resolvers>
        <ibiblio name="central" m2compatible="true"/>
    </resolvers>
</ivysettings>