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 Leszek Gruchała <le...@ncdc.pl> on 2008/04/15 12:47:27 UTC

Ivy doesn't download dependences

Hi,
I cannot find resolution for my problem, so I hope You can help me ;)

I have modified go-ivy project. I added some stuff to ivysettings.xml 
and ivy.xml. When I try to download dependences:
a) with ivy-2.0.0-beta2 I've got build failed
b) with ivy from svn (05/04/2008)
I've got:

[ivy:resolve] == resolving dependencies 
ncdc#go-ivy;working@leszek.ncdc->junit#junit;4.4 [test->test]
[ivy:resolve]         tried 
http://javarepo.xoocode.org/module/junit/junit/4.4/junit-4.4.jar
[ivy:resolve]     ibiblio_maven2: no ivy file found for junit#junit;4.4: 
using default data
[ivy:resolve]     found junit#junit;4.4 in ibiblio_maven2
[ivy:resolve] configuration required by evicted revision is not 
available in selected revision. skipping test in junit#junit;4.4
[ivy:resolve]     resolved ivy file produced in 
/home/leszek/.ivy2/cache/resolved-ncdc-go-ivy-working@leszek.ncdc.xml
[ivy:resolve] :: downloading artifacts ::
[ivy:resolve] :: resolution report :: resolve 348ms :: artifacts dl 0ms
    ---------------------------------------------------------------------
    |                  |            modules            ||   artifacts   |
    |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
    ---------------------------------------------------------------------
    |        api       |   0   |   0   |   0   |   0   ||   0   |   0   |
    |   homemade-impl  |   0   |   0   |   0   |   0   ||   0   |   0   |
    |      cc-impl     |   1   |   1   |   0   |   0   ||   0   |   0   |
    |       test       |   2   |   2   |   0   |   0   ||   0   |   0   |
    ---------------------------------------------------------------------
and build successful, but nothing download.

My files:
[ant target]
    <target name="retrieve" description="Retrieves the libraries if needed">
        <!-- Ivy configuration -->
        <ivy:settings file="${ivy.settings.file}" />
        <condition property="ivy.conf.name" value="*">
            <not>
                <isset property="ivy.conf.name" />
            </not>
        </condition>
        <echo message="Ivy conf name: ${ivy.conf.name}" />
        <ivy:resolve conf="${ivy.conf.name}" />
        <ivy:retrieve conf="${ivy.conf.name}" />
    </target>

[ivysettings.xml]
<?xml version="1.0" encoding="UTF-8"?>
<ivysettings>
    <settings defaultResolver="ibiblio_maven2" />
    <cache basedir="cache" />
    <resolvers>
        <chain name="local">
            <filesystem name="lib_dir">
                <ivy
                    
pattern="${ivy.lib.dir}/local/[organisation]/[module]/[revision]/ivy/ivy.xml" 
/>

                <artifact
                    
pattern="${ivy.lib.dir}/local/[organisation]/[module]/[revision]/[type]/[artifact].[ext]" 
/>
            </filesystem>
        </chain>
        <url name="ibiblio_maven2" m2compatible="true" >
            <artifact
                
pattern="http://javarepo.xoocode.org/module/[organisation]/[module]/[revision]/[artifact](-[revision]).[ext]" 
/>
            <artifact
                
pattern="http://javarepo.xoocode.org/module/[organisation]/[artifact]/[revision]/[artifact](-[revision]).[ext]" 
/>
        </url>
    </resolvers>
    <modules>
        <module organisation="*" name=".*" resolver="ibiblio_maven2" />
    </modules>
</ivysettings>

[ivy.xml]
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/ivy/ivy-doc.xsl"?>
<ivy-module version="2.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
    <info organisation="ncdc" module="go-ivy" />  
    <configurations>
        <conf name="api" description="only provide go-ivy API" />
        <conf name="homemade-impl" extends="api"
            description="provide a home made implementation of our api" />
        <conf name="cc-impl" extends="api"
            description="provide an implementation that use apache 
common collection framework" />
        <conf name="test" extends="cc-impl" visibility="private"
            description="for testing our framework" />
    </configurations>
    <publications>
        <artifact name="filter-api" type="jar" conf="api" ext="jar" />
        <artifact name="filter-hmimpl" type="jar" conf="homemade-impl"
            ext="jar" />
        <artifact name="filter-ccimpl" type="jar" conf="cc-impl"
            ext="jar" />
    </publications>
    <dependencies>
        <dependency org="commons-lang" name="commons-lang" rev="2.4"
            conf="cc-impl" />
        <dependency org="junit" name="junit" rev="4.4" conf="test" />
    </dependencies>
</ivy-module>


Any help would be appreciated. I You want more information, please tell.

Thanks for any help

Regards
Leszek

Re: Ivy doesn't download dependences

Posted by Xavier Hanin <xa...@gmail.com>.
On Tue, Apr 15, 2008 at 12:47 PM, Leszek Gruchała <le...@ncdc.pl> wrote:

> Hi,
> I cannot find resolution for my problem, so I hope You can help me ;)
>
> I have modified go-ivy project. I added some stuff to ivysettings.xml and
> ivy.xml. When I try to download dependences:
> a) with ivy-2.0.0-beta2 I've got build failed
> b) with ivy from svn (05/04/2008)
> I've got:
>
> [ivy:resolve] == resolving dependencies ncdc#go-ivy;working@leszek.ncdc->junit#junit;4.4
> [test->test]
> [ivy:resolve]         tried
> http://javarepo.xoocode.org/module/junit/junit/4.4/junit-4.4.jar
> [ivy:resolve]     ibiblio_maven2: no ivy file found for junit#junit;4.4:
> using default data
> [ivy:resolve]     found junit#junit;4.4 in ibiblio_maven2
> [ivy:resolve] configuration required by evicted revision is not available
> in selected revision. skipping test in junit#junit;4.4
> [ivy:resolve]     resolved ivy file produced in
> /home/leszek/.ivy2/cache/resolved-ncdc-go-ivy-working@leszek.ncdc.xml
> [ivy:resolve] :: downloading artifacts ::
> [ivy:resolve] :: resolution report :: resolve 348ms :: artifacts dl 0ms
>   ---------------------------------------------------------------------
>   |                  |            modules            ||   artifacts   |
>   |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
>   ---------------------------------------------------------------------
>   |        api       |   0   |   0   |   0   |   0   ||   0   |   0   |
>   |   homemade-impl  |   0   |   0   |   0   |   0   ||   0   |   0   |
>   |      cc-impl     |   1   |   1   |   0   |   0   ||   0   |   0   |
>   |       test       |   2   |   2   |   0   |   0   ||   0   |   0   |
>   ---------------------------------------------------------------------
> and build successful, but nothing download.
>
> My files:
> [ant target]
>   <target name="retrieve" description="Retrieves the libraries if needed">
>       <!-- Ivy configuration -->
>       <ivy:settings file="${ivy.settings.file}" />
>       <condition property="ivy.conf.name" value="*">
>           <not>
>               <isset property="ivy.conf.name" />
>           </not>
>       </condition>
>       <echo message="Ivy conf name: ${ivy.conf.name}" />
>       <ivy:resolve conf="${ivy.conf.name}" />
>       <ivy:retrieve conf="${ivy.conf.name}" />
>   </target>
>
> [ivysettings.xml]
> <?xml version="1.0" encoding="UTF-8"?>
> <ivysettings>
>   <settings defaultResolver="ibiblio_maven2" />
>   <cache basedir="cache" />
>   <resolvers>
>       <chain name="local">
>           <filesystem name="lib_dir">
>               <ivy
>
> pattern="${ivy.lib.dir}/local/[organisation]/[module]/[revision]/ivy/ivy.xml"
> />
>
>               <artifact
>
> pattern="${ivy.lib.dir}/local/[organisation]/[module]/[revision]/[type]/[artifact].[ext]"
> />
>           </filesystem>
>       </chain>
>       <url name="ibiblio_maven2" m2compatible="true" >
>           <artifact
>               pattern="
> http://javarepo.xoocode.org/module/[organisation]/[module]/[revision]/[artifact](-[revision]).[ext]<http://javarepo.xoocode.org/module/%5Borganisation%5D/%5Bmodule%5D/%5Brevision%5D/%5Bartifact%5D%28-%5Brevision%5D%29.%5Bext%5D>"
> />
>           <artifact
>               pattern="
> http://javarepo.xoocode.org/module/[organisation]/[artifact]/[revision]/[artifact](-[revision]).[ext]<http://javarepo.xoocode.org/module/%5Borganisation%5D/%5Bartifact%5D/%5Brevision%5D/%5Bartifact%5D%28-%5Brevision%5D%29.%5Bext%5D>"
> />
>       </url>
>   </resolvers>
>   <modules>
>       <module organisation="*" name=".*" resolver="ibiblio_maven2" />
>   </modules>
> </ivysettings>
>
> [ivy.xml]
> <?xml version="1.0" encoding="UTF-8"?>
> <?xml-stylesheet type="text/xsl" href="/ivy/ivy-doc.xsl"?>
> <ivy-module version="2.0"
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd
> ">
>   <info organisation="ncdc" module="go-ivy" />     <configurations>
>       <conf name="api" description="only provide go-ivy API" />
>       <conf name="homemade-impl" extends="api"
>           description="provide a home made implementation of our api" />
>       <conf name="cc-impl" extends="api"
>           description="provide an implementation that use apache common
> collection framework" />
>       <conf name="test" extends="cc-impl" visibility="private"
>           description="for testing our framework" />
>   </configurations>
>   <publications>
>       <artifact name="filter-api" type="jar" conf="api" ext="jar" />
>       <artifact name="filter-hmimpl" type="jar" conf="homemade-impl"
>           ext="jar" />
>       <artifact name="filter-ccimpl" type="jar" conf="cc-impl"
>           ext="jar" />
>   </publications>
>   <dependencies>
>       <dependency org="commons-lang" name="commons-lang" rev="2.4"
>           conf="cc-impl" />
>       <dependency org="junit" name="junit" rev="4.4" conf="test" />
>   </dependencies>
> </ivy-module>
>
> The main problem I see is that your settings are not correct:
javarepo.xoocode.org is not an actual repository (yet?), it only provides a
module searching facility. So making your ibiblio resolver point to javarepo
doesn't make sense. Moreover, the ibiblio resolver is not intended to be
used with <artifact pattern=""/> sub elements. It supports them because it's
actually a subclass of url resolver, but you should better use the url
resolver if you want to set your patterns yourself.

So my recommendation would be to perform one change at a time when you want
to try out things: First try what you without changing the settings, then
add one resolver in your settings, then one module, and so on. It will be
much easier for you to understand what's going on, and for people to help
you when you are in trouble.

HTH,

Xavier

>
> Any help would be appreciated. I You want more information, please tell.
>
> Thanks for any help
>
> Regards
> Leszek
>



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