You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Andrey Fedorov <an...@gmail.com> on 2009/03/26 22:29:21 UTC

ivysettings resolver

I'm trying to understand how resolvers work in my Ivy settings file. So,
ivysettings.xml file includes:

<url name="com.springsource.repository.bundles.external">
>     <ivy pattern="
> http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
> />
>     <artifact pattern="
> http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
> />
> </url>
>

And my ivy.xml file includes:

<dependency org="org.junit"
>             name="com.springsource.org.junit"
>             rev="4.4.0" />
>

>From when I ran Ivy, I can tell that this resolves to:
http://repository.springsource.com/ivy/bundles/external/org.junit/com.springsource.org.junit/4.4.0/com.springsource.org.junit-sources-4.4.0.jar

So the resolutions go:

    [organization] => "org.junit"
    [module] => "com.springsource.org.junit"
    [revision] => "4.4.0"
    [artifact] => "com.springsource.org.junit-sources"
    [ext] => "jar"

I see how ivy resolves the [organization], [module], and [revision] in the
URL pattern (duh), but how does it resolve [artifact] and [ext]?

The documentation on the URL resolver [1] seems to be lacking.

I've also posted this question to the stackoverflow community [2]. If you'd
like, please answer there, as well as on the list. If you would rather not,
I hope it's OK if I copy your best responses to there.

Cheers,
Andrey

  [1]: http://ant.apache.org/ivy/history/trunk/resolver/url.html
  [2]:
http://stackoverflow.com/questions/686188/how-does-apache-ivy-resolve-the-variables-in-artifact-patterns-provided-in-the-iv

Re: ivysettings resolver

Posted by Andrey Fedorov <an...@gmail.com>.
Ah, that makes sense! Thanks, Maarten
Cheers,
Andrey

On Fri, Mar 27, 2009 at 3:54 AM, Maarten Coene <ma...@yahoo.com>wrote:

>
> For example, in your situation, Ivy will look at the
> "com.springsource.org.junit" moduledescriptor and will download the
> artifacts declared in there:
>
> http://repository.springsource.com/ivy/bundles/external/org.junit/com.springsource.org.junit/4.4.0/ivy-4.4.0.xml
>
> Maarten
>
>
>
>
>
> ----- Original Message ----
> From: Archie Cobbs <ar...@gmail.com>
> To: ivy-user@ant.apache.org
> Sent: Friday, March 27, 2009 2:38:22 AM
> Subject: Re: ivysettings resolver
>
> On Thu, Mar 26, 2009 at 4:29 PM, Andrey Fedorov <an...@gmail.com>
> wrote:
>
>
>
>
> The artifacts and their extensions are defined by the module you are
> depending on. Since your dependency doesn't specify any configuration, you
> are getting all JAR artifacts. The reason you are getting JAR artifacts and
> not some other type is because "jar" is the default.
>
> Reading the docs for the <dependency> tag should help explain some of this
> a
> little better (hopefully).
>
> -Archie
>
> --
> Archie L. Cobbs
>
>
>
>
>

Re: ivysettings resolver

Posted by Maarten Coene <ma...@yahoo.com>.
For example, in your situation, Ivy will look at the "com.springsource.org.junit" moduledescriptor and will download the artifacts declared in there:
http://repository.springsource.com/ivy/bundles/external/org.junit/com.springsource.org.junit/4.4.0/ivy-4.4.0.xml

Maarten





----- Original Message ----
From: Archie Cobbs <ar...@gmail.com>
To: ivy-user@ant.apache.org
Sent: Friday, March 27, 2009 2:38:22 AM
Subject: Re: ivysettings resolver

On Thu, Mar 26, 2009 at 4:29 PM, Andrey Fedorov <an...@gmail.com> wrote:




The artifacts and their extensions are defined by the module you are
depending on. Since your dependency doesn't specify any configuration, you
are getting all JAR artifacts. The reason you are getting JAR artifacts and
not some other type is because "jar" is the default.

Reading the docs for the <dependency> tag should help explain some of this a
little better (hopefully).

-Archie

-- 
Archie L. Cobbs



      

Re: ivysettings resolver

Posted by Archie Cobbs <ar...@gmail.com>.
On Thu, Mar 26, 2009 at 4:29 PM, Andrey Fedorov <an...@gmail.com> wrote:

> I'm trying to understand how resolvers work in my Ivy settings file. So,
> ivysettings.xml file includes:
>
> <url name="com.springsource.repository.bundles.external">
> >     <ivy pattern="
> >
> http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]<http://repository.springsource.com/ivy/bundles/external/%5Borganisation%5D/%5Bmodule%5D/%5Brevision%5D/%5Bartifact%5D-%5Brevision%5D.%5Bext%5D>
> "
> > />
> >     <artifact pattern="
> >
> http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]<http://repository.springsource.com/ivy/bundles/external/%5Borganisation%5D/%5Bmodule%5D/%5Brevision%5D/%5Bartifact%5D-%5Brevision%5D.%5Bext%5D>
> "
> > />
> > </url>
> >
>
> And my ivy.xml file includes:
>
> <dependency org="org.junit"
> >             name="com.springsource.org.junit"
> >             rev="4.4.0" />
> >
>
> From when I ran Ivy, I can tell that this resolves to:
>
> http://repository.springsource.com/ivy/bundles/external/org.junit/com.springsource.org.junit/4.4.0/com.springsource.org.junit-sources-4.4.0.jar
>
> So the resolutions go:
>
>    [organization] => "org.junit"
>    [module] => "com.springsource.org.junit"
>    [revision] => "4.4.0"
>    [artifact] => "com.springsource.org.junit-sources"
>    [ext] => "jar"
>
> I see how ivy resolves the [organization], [module], and [revision] in the
> URL pattern (duh), but how does it resolve [artifact] and [ext]?


The artifacts and their extensions are defined by the module you are
depending on. Since your dependency doesn't specify any configuration, you
are getting all JAR artifacts. The reason you are getting JAR artifacts and
not some other type is because "jar" is the default.

Reading the docs for the <dependency> tag should help explain some of this a
little better (hopefully).

-Archie

-- 
Archie L. Cobbs