Tuesday, December 18, 2007

Ivy + Maven 2 snapshot respositories


Ivy has some support for Maven repositories which is a great thing. I can easily use libraries that are stored on http://repository.jboss.org/maven2 for example.
But i also need to use snapshot versions of some libraries. Maven2 deal with snapshot version is a different way and add a timestamp to the library names. For example:
http://snapshots.jboss.org/maven2/org/jboss/portal/common/jboss-portal-modules-common/1.1.0-SNAPSHOT/jboss-portal-modules-common-1.1.0-20071217.115828-11.jar

Ivy doesn't know how to deal with that (see this thread). And there is an open Jira for it: IVY-243 (Please vote for it).

So i'm trying to create my own resolver by extending the ibiblio one, i was able to do most of it. I'm now stuck, ivy only gets the latest pom from the snapshot but silently ignores the jar files.

This is how i configured it:

<snapshots name="snapshots" m2compatible="true" pattern="[organisation]/[module]/[revision]/[artifact]-[snapshotrevision](-[classifier]).[ext]" root="http://snapshots.jboss.org/maven2"></snapshots>

After i wrote a new pattern for [snapshotrevision] which grabs the version number with the latest timestamp and build number taken from:
http://snapshots.jboss.org/maven2/[organisation]/[module]/[revision]/maven-metadata.xml

There is no magic in my code, so I am still wondering what i'm doing wrong...

EDIT: December 19th
I got it to work now. Cool i can access the snapshot repository of JBoss from Ivy.

1 comments:

Anonymous said...

Well, I think your problem is you don't have any magic in your code.