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: Read from Maven local repository
Date Tue, 08 May 2007 15:37:15 GMT
Hi,

First if you use the 1.4 version, the settings file was called
configuration file and not settings file. This is important because
the tags used in the file have changed too. So make sure to use the
1.4 documentation and not doc from the web site if you use 1.4. OTOH,
if you plan to use maven compatiblity as you seem to be, I'd recommend
using 2.0 alpha 1, in which we have fixed some bugs related to pom
parsing.

So now for your settings. First I'm surprised that at your first
attempt Ivy tries to download files from a remote repository. Maybe it
hasn't loaded your settings at all. Check your console output to make
sure of which settings is used.

Your second problem is related to the fact that you do not define a
default resolver, so Ivy doesn't know which resolver to use to resolve
your dependencies (even if with only one resolver Ivy could make a
pretty good guess :-)). So you need to add this line:
<settings defaultResolver="local-maven2" />
or
<conf defaultResolver="local-maven2" />
for Ivy 1.4.

HTH,

Xavier


On 5/7/07, Fred Vos <fred@fredvos.org> wrote:
> Hello,
>
> I'm completely new to Ivy. At the moment I'm using Maven to build my
> software. Now I'm trying to collect dependencies automatically in the
> target/lib directory using Ivy 1.4.1 on the command line. Later I want to
> fetch my jars from within a Java program. I want Ivy to fetch the jars from my
> local Maven repository at ~/.m2/repository only. How do I setup my
> ivysettings.xml for that?
>
> Here's my ivy.xml file:
>
> <?xml version="1.0"?>
> <ivy-module version="1.0">
>   <info organisation="org" module="standalone" revision="working"/>
>   <dependencies>
>     <dependency org="xom" name="xom" rev="1.1" conf="default->*"/>
>     <dependency org="com.martiansoftware" name="jsap" rev="2.1"
>     conf="default->*"/>
>   </dependencies>
> </ivy-module>
>
> and my ivysettings.xml file:
>
> <?xml version="1.0"?>
> <ivysettings>
>   <property name="local-maven2-pattern"
>   value="file:${user.home}/.m2/repository/[organisation]/[module]/[revision]/[module]-[revision].[ext]"
override="false" />
>   <resolvers>
>     <url name="local-maven2" m2compatible="true">
>       <artifact pattern="${local-maven2-pattern}"/>
>     </url>
>   </resolvers>
> </ivysettings>
>
> When I do
>
> % java -cp <classpath> fr.jayasoft.ivy.Main
>
> it tries to download xom from an external repository (successfull) and jsap
> (not successfull). But this is not what I want. I already have both xom and
> jsap and all their dependencies in my local maven repository and want to use
> that repository.
>
> When I do
>
> % java -cp <classpath> fr.jayasoft.ivy.Main -conf ivysettings.xml
>
> it complains for both xom and jsap that it cannot find a resolver:
>
> :: [ xom | xom | 1.1 ]: no resolver found for [ xom | xom ]: check your
> configuration
>
> So I guess something is wrong with my ivysettings.xml file. Can someone help
> me with this first step?
>
> Thanks,
>
> Fred
>
> --
> |E  R
> | D  F
> |
> |fred at fredvos dot org
> |5235 DG 52 NL +31 73 6411833
>


-- 
Xavier Hanin - Independent Java Consultant
Manage your dependencies with Ivy!
http://incubator.apache.org/ivy/

Mime
View raw message