I have an artifact in my local file system, but Ivy will not allow it unless I put the <file system> resolver inside the <chain>. And he renames the extension of the artifact when he resolves it.
Here is my ivy.xml:
<ivy-module version="2.0"> <info organisation="apache" module="hello-ivy"/> <dependencies> <dependency org="myorg" name="mymodule" rev="1.1-SNAPSHOT"/> </dependencies> </ivy-module>
And here is my ivysettings.xml:
<ivysettings> <settings /> <resolvers> <filesystem name="local"> <artifact pattern="/path/to/my/artifact/[module]/dist/[module]-[revision].zip" /> </filesystem> </resolvers> </ivysettings>
My build.xml:
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="hello-ivy" default="deps"> <target name="deps" description="--> retrieve dependencies with ivy"> <ivy:settings file="ivysettings.xml"/> <ivy:resolve /> <ivy:retrieve /> </target> </project>
An artifact is a .zip file. It is in the right place and correctly named (according to the <artifact> attribute. But when I run ant, it cannot resolve the artifact:
[ivy:resolve] :::: WARNINGS [ivy:resolve] :::::::::::::::::::::::::::::::::::::::::::::: [ivy:resolve] :: UNRESOLVED DEPENDENCIES :: [ivy:resolve] :::::::::::::::::::::::::::::::::::::::::::::: [ivy:resolve] :: myorg#mymodule;1.1-SNAPSHOT: no resolver found for myorg#mymodule: check your configuration [ivy:resolve] :::::::::::::::::::::::::::::::::::::::::::::: [ivy:resolve] :::: ERRORS [ivy:resolve] unknown resolver null [ivy:resolve] no resolver found for myorg#mymodule: check your configuration
Why doesn't he find my module?
Then: if I put the <file system> element inside the <chain> element, it solves:
[ivy:resolve] found myorg#mymodule;1.1-SNAPSHOT in local [ivy:resolve] downloading /path/to/my/artifact/mymodule/dist/mymodule-1.1-SNAPSHOT.zip [ivy:resolve] ..................(lots of dots here).....(37899kB) [ivy:resolve] [SUCCESSFUL ] myorg#mymodule;1.1-SNAPSHOT!mymodule.jar (430ms)
So strange. Why does <chain> make a difference? And BTW, why is my module now JAR ??? The source is a ZIP file, I swear. This is also correct, I just rebuilt the ZIP, and the latest changes are in my JAR file. Why did Ivy rename it?