ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xavier Hanin" <xavier.ha...@gmail.com>
Subject Re: Chain resolver behavior
Date Tue, 08 Apr 2008 07:49:23 GMT
On Mon, Apr 7, 2008 at 9:06 PM, Marshall Pierce <marshall@genius.com> wrote:

> 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?)


returnFirst is used to know if when you ask for a dynamic revision of a
module (like the latest one) Ivy should trust the first resolver in the
chain that finds a revision of the module, or if it should continue in the
list to see if another resolver has a more recent version. Once Ivy finds a
module metadata in a resolver, by default Ivy asks the same resolver to get
the artifacts. In your case that's what is happening: the main resolver
finds metadata for JTA, and so Ivy asks the main resolver to get the
artifacts, which doesn't work. The attribute to change this behaviour and
make the chain asks all resolvers to find the artifacts is dual="true". This
makes the chain resolver behave as the dual resolver with the whole chain.

HTH,

Xavier


>
>
> Thanks for any help.
>
> Marshall Pierce
>



-- 
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message