I'm not quite understanding some behavior I'm seeing from the chain
resolver. First, a bit of background: I need JTA for Hibernate since I'm
not operating within a servlet, but JTA is not in the public Maven
repositories (licensing & whatnot), so I need to use java.net's
repository in addition to the standard one.
This is my ivysettings.xml:
<ivysettings>
<settings defaultResolver="custom" />
<include url="${ivy.default.settings.dir}/ivysettings-public.xml" />
<include url="${ivy.default.settings.dir}/ivysettings-shared.xml"/>
<include url="${ivy.default.settings.dir}/ivysettings-local.xml" />
<include url="${ivy.default.settings.dir}/ivysettings-main-chain.xml"/>
<!--<include
url="${ivy.default.settings.dir}/ivysettings-default-chain.xml"/>-->
<resolvers>
<chain
name="custom"
returnFirst="false">
<resolver ref="local" />
<resolver ref="main" />
<ibiblio
name="java.net-maven-2"
root="http://download.java.net/maven/2/"
m2compatible="true"
pattern="[organization]/[module]/[revision]/[module]-[revision].[ext]" />
</chain>
</resolvers>
</ivysettings>
This does not work -- it fails to find jta.jar. It's the same if I set
returnFirst to true, but it works fine (with returnFirst set either way)
if I move the "main" resolver ref below the java.net-maven-2 resolver.
Why would this be the case? Also, what exactly does returnFirst mean for
a chain resolver if it's obviously *not* trying all the listed resolvers
in the chain, regardless whether or not it actually finds the requested
jar... if it really was trying them all, it would find JTA on the
java.net-maven-2 repos. (I had to set a custom pattern to make the
java.net-maven-2 resolver look in the right place -- is this because of
some setting I'm missing, or is java.net's repos just laid out oddly?)
Thanks for any help.
Marshall Pierce