tags:

views:

562

answers:

1

I have been playing with the basic Ivy Tutorial and have gradually extended to a state where I now have a seprate ivy.xml defining my dependancies and with the ivy jar inside the apache ant installation.

I have also managed to define a shared repository to stop ivy popping off to an external repository. This has been done by defining properties in the resolve task.

<target name="resolve" depends="" description="Resolve the dependencies">  
    <property name="ivy.shared.default.root"             value="C:/ivy/localLibsStore" />
    <property name="ivy.shared.default.artifact.pattern" value="[module]/[revision]/[type]s/[artifact]-[revision].[ext]" />
        <ivy:retrieve/>  
    </target> 

However I have tried moving these properties into a separate ivysettings.xml file with no luck.

So the question is what should I have in my ivysettings.xml ?

My latest attempt below gives the error:

unknown resolver null

no resolver found for ...

<ivysettings>
    <property name="ivy.shared.default.root"             value="C:/ivy/localLibsStore" />
    <property name="ivy.shared.default.artifact.pattern" value="[module]/[revision]/[type]s/[artifact]-[revision].[ext]" />

        <resolvers>
            <filesystem name="shared">
              <ivy pattern="${ivy.shared.default.root}/${ivy.shared.default.ivy.pattern}" />
              <artifact pattern="${ivy.shared.default.root}/${ivy.shared.default.artifact.pattern}" />
            </filesystem>
        </resolvers>
</ivysettings>
+1  A: 

sussed it.

Found this good description of ivy

I have changed my settings.xml to look like this

<ivysettings>
    <settings defaultResolver="chained"/>
    <property name="java.net.maven.pattern" value="[organisation]/jars/[module]-[revision].[ext]"/>
    <property name="ivy.shared.default.root"             value="C:/ivy/localLibsStore" />
    <property name="ivy.shared.default.artifact.pattern" value="[module]/[revision]/[type]s/[artifact]-[revision].[ext]" />
    <resolvers>
        <filesystem name="sharedbill">
            <ivy pattern="${ivy.shared.default.root}/${ivy.shared.default.ivy.pattern}" />
            <artifact pattern="${ivy.shared.default.root}/${ivy.shared.default.artifact.pattern}" />
        </filesystem>
        <chain name="chained" returnFirst="true">
            <resolver ref="sharedbill"/>
            <ibiblio name="ibiblio" m2compatible="true"/>
            <ibiblio name="java-net-maven1" root="http://download.java.net/maven/1&quot; pattern="${java.net.maven.pattern}" m2compatible="false"/>
            <ibiblio name="java-net-maven2" root="http://download.java.net/maven/2/&quot; m2compatible="true"/>
            <url name="sourceforge">
                <artifact pattern="http://easynews.dl.sourceforge.net/sourceforge/[organization]/[module]_[revision].zip&quot; />
                <artifact pattern="http://easynews.dl.sourceforge.net/sourceforge/[organization]/[module]-[revision].zip&quot; />
            </url>
        </chain>
    </resolvers>
</ivysettings>
Bill Comer