I am trying to create custom resolver in my ivysettings.xml file:
<ivysettings>
<settings defaultResolver="default"/>
<resolvers>
<chain name="default">
<url name="scala-tools">
<ivy pattern="http://scala-tools.org/repo-releases/[organisation]/[module]/[revision]/ivy-[revision].xml" />
<artifact pattern="http://scala-tools.org/repo-releases/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"/>
<artifact pattern="http://scala-tools.org/repo-releases/[organisation]/[module]/[revision]/[artifact].[ext]"/>
</url>
<!--<ibiblio name="ibiblio"/>-->
</chain>
</resolvers>
</ivysettings>
As you can see, I have just one UrlResolver that will try to find my dependencies in scala-tools repo. If I specify my dependencies correctly than ivy will try to find it in http://scala-tools.org/repo-releases/org.scala-lang/scala-library/2.8.0/scala-library-2.8.0.jar and http://scala-tools.org/repo-releases/org.scala-lang/scala-library/2.8.0/scala-library.jar (yep, according to my instructions in ivysettings.xml) Obviously, it doesn’t find anything. To get thing working I must specify dependencies in this way:
<ivy-module version="2.2">
<info organisation="org.yoba" module="Yoba"/>
<dependencies>
<dependency org="org/scala-lang" name="scala-library" rev="2.8.0"/>
<!--<dependency org="org.scala-lang" name="scala-library" rev="2.8.0"/>-->
<dependency org="org/scala-lang" name="scala-compiler" rev="2.8.0"/>
<!--<dependency org="org.scala-lang" name="scala-compiler" rev="2.8.0"/>-->
</dependencies>
</ivy-module>
Q:How to change artifact pattern / something else to force ivy to make it’s job right way?
1: http://scala-tools.org/repo-releases/ scala-tools repo
ivy.xml
I checked the POM for scala-compiler and discovered that it references the module scala-library. This means only need one dependency declaration is required in the ivy file:
ivysettings.xml
I recommend using the ibiblio resolver when downloading from any Maven compliant repository.
If you need to download other libraries the settings file can be enhanced, so that ivy only retrieves the scala modules from the scala repository