ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fred Vos <f...@fredvos.org>
Subject Re: Read from Maven local repository
Date Thu, 10 May 2007 22:09:58 GMT
On Wed, May 09, 2007 at 11:24:31PM +0200, Xavier Hanin wrote:
> First, could you please subscribe to the list, your messages are moderated
> each time.

You're right and I'm sorry. I subscribed.

> You can use even -debug if verbose is not enough. The reason is usually that
> Ivy doesn't find appropriate metadata. It may happen that this is only
> cache's fault, so clean your cache and try again. If you still have trouble,
> check your ivy cache after a resolve, and check the ivy file generated by
> ivy for your dependencies. If they you see a default="true" attribute Ivy
> has not found your pom. The debug log at least should tell which attempts
> Ivy does.
> 
> One thing I think about, since you are using poms with an url resolver, it's
> a good idea to tell ivy to use pom as extension. Replace your ivy pattern by
> this one:
> <ivy pattern="file:${user.home
> }/.m2/repository/[organisation]/[module]/[revision]/[module]-[revision].pom
> "/>

This is the solution! With this small change I get all my dependencies.

> 
> Last, I recommend using a file system resolver instead of an url one when
> using file based repository. It allows to get revision listings.

Ok, I changed that and got it working too with this filesystem resolver.

Now I can try to solve a circular dependency. The transitive dependencies of
xom 1.1 make an excellent example of horrific dependencies in Maven repo1. I
don't think I need help solving this. Thank you Xavier. These are my files now:

ivysetings.xml
--------------
<?xml version="1.0"?>
<settings defaultResolver="local-maven2">
  <property name="local-maven2-pattern"
  value="${user.home}/.m2/repository/[organisation]/[module]/[revision]/[module]-[revision].pom"
override="false" />
  <resolvers>
    <filesystem name="local-maven2" m2compatible="true">
      <ivy pattern="${local-maven2-pattern}"/>
      <artifact pattern="${local-maven2-pattern}"/>
    </filesystem>
  </resolvers>
</settings>

ivy.xml
-------
<?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>

The command I used to fill the target/lib directory with all dependencies:

java -cp <classpath> org.apache.ivy.Main -settings ivysettings.xml -retrieve "target/lib/[artifact]-[revision].[ext]"

(using ivy-2.0.0-alpha-1, Sun Java 1.6.0)

%ls -1 target/lib
dom4j-1.6.1.jar
jaxen-1.1-beta-8.jar
jdom-1.0.jar
jsap-2.1.jar
xalan-2.7.0.jar
xercesImpl-2.6.2.jar
xml-apis-2.0.2.jar
xmlParserAPIs-2.6.2.jar
xom-1.1.jar

Fred

Mime
View raw message