Apache ivy - what is in ivysettings.xml

I played with the basic Ivy Tutorial and gradually expanded to the state where I now have seprate ivy.xml, which defines my dependencies and with a can of ivy inside the apache ant installation.

I was also able to identify a common repository to stop ivy popping into an external repository. This was done by defining the properties in the resolution 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 tried moving these properties to a separate ivysettings.xml file with no luck.

So the question is what do I need in my ivysettings.xml?

My last attempt below gives an error:

unknown resolver null

no recognizer ...

<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>
+3
source share
1 answer

suggested him.

settings.xml,

<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" pattern="${java.net.maven.pattern}" m2compatible="false"/>
            <ibiblio name="java-net-maven2" root="http://download.java.net/maven/2/" m2compatible="true"/>
            <url name="sourceforge">
                <artifact pattern="http://easynews.dl.sourceforge.net/sourceforge/[organization]/[module]_[revision].zip" />
                <artifact pattern="http://easynews.dl.sourceforge.net/sourceforge/[organization]/[module]-[revision].zip" />
            </url>
        </chain>
    </resolvers>
</ivysettings>
+4

Source: https://habr.com/ru/post/1724947/


All Articles