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 Alan Romaniuc <a....@gmail.com> on 2008/02/20 02:51:30 UTC

Newbie questions about ivy files, artifacts and poms

Hi,

It is possible to configure ivy in the following scenario:
1) Look for ivy files in a local folder
2) Search in ibiblio for not found local ivy files
3) Search in ibiblio for pom files
4) Search anywhere else for ivy files

5) If a file can be found in cache, get from there
6) Download files not found from repo 2
7) Keep searching other repos.



I have the following ivysettings file:

------------------------------------------
<ivysettings>
    <property name="ivy.local.default.root"
value="${ivy.default.ivy.user.dir}/local" override="false"/>
    <property name="ivy.local.default.ivy.pattern"
value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
override="false"/>
    <property name="ivy.local.default.artifact.pattern"
value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
override="false"/>
    <settings defaultResolver="default"/>
    <resolvers>
        <chain name="default" >
            <ibiblio name="ibiblio" m2compatible="true" usepoms="true" />
            <url name="wicket-stuff" m2compatible="true">
                <artifact
pattern="http://wicketstuff.org/maven/repository/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"/>
            </url>
            <filesystem name="local-ivy" >
                <ivy
pattern="${ivy.project.dir}/ivy/[organisation]/[module]/ivy-[revision].xml"
/>
            </filesystem>
        </chain>
    </resolvers>
</ivysettings>
------------------------------------------
So,. lets suppose that I have a hibernate and wicket dependency.
hibernate has a local ivy file, but wicket not. I also do not have a
hibernate jar in cache, so it should download from ibiblio or
wicket-stuff respecting my ivy file. There is not a wicket ivy file,
so it would try ivy files from anywhere else or pom files.

When I use that configuration, ivy search hibernate locally only,
giving me a fail, and wicket runs fine.

Is it possible to do that?


Thanks


-- 
Alan R.

Re: Newbie questions about ivy files, artifacts and poms

Posted by Xavier Hanin <xa...@gmail.com>.
On Wed, Feb 20, 2008 at 2:51 AM, Alan Romaniuc <a....@gmail.com> wrote:

> Hi,
>
> It is possible to configure ivy in the following scenario:
> 1) Look for ivy files in a local folder
> 2) Search in ibiblio for not found local ivy files
> 3) Search in ibiblio for pom files
> 4) Search anywhere else for ivy files
>
> 5) If a file can be found in cache, get from there
> 6) Download files not found from repo 2
> 7) Keep searching other repos.


Yes, this is possible. What you need is use a dual resolver where the first
part is a chain of resolvers doing #1 #2 #3 #4, and the second part is a
chain doing #6 and #7. #5 is always done by Ivy cache management, unless you
use a custom cache manager if you want something very specific.

Xavier


>
>
>
>
> I have the following ivysettings file:
>
> ------------------------------------------
> <ivysettings>
>    <property name="ivy.local.default.root"
> value="${ivy.default.ivy.user.dir}/local" override="false"/>
>    <property name="ivy.local.default.ivy.pattern"
> value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
> override="false"/>
>    <property name="ivy.local.default.artifact.pattern"
> value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
> override="false"/>
>    <settings defaultResolver="default"/>
>    <resolvers>
>        <chain name="default" >
>            <ibiblio name="ibiblio" m2compatible="true" usepoms="true" />
>            <url name="wicket-stuff" m2compatible="true">
>                <artifact
> pattern="
> http://wicketstuff.org/maven/repository/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]<http://wicketstuff.org/maven/repository/%5Borganisation%5D/%5Bmodule%5D/%5Brevision%5D/%5Bartifact%5D-%5Brevision%5D.%5Bext%5D>
> "/>
>            </url>
>            <filesystem name="local-ivy" >
>                <ivy
> pattern="${ivy.project.dir
> }/ivy/[organisation]/[module]/ivy-[revision].xml"
> />
>            </filesystem>
>        </chain>
>    </resolvers>
> </ivysettings>
> ------------------------------------------
> So,. lets suppose that I have a hibernate and wicket dependency.
> hibernate has a local ivy file, but wicket not. I also do not have a
> hibernate jar in cache, so it should download from ibiblio or
> wicket-stuff respecting my ivy file. There is not a wicket ivy file,
> so it would try ivy files from anywhere else or pom files.
>
> When I use that configuration, ivy search hibernate locally only,
> giving me a fail, and wicket runs fine.
>
> Is it possible to do that?
>
>
> Thanks
>
>
> --
> Alan R.
>



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