ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Arentz" <>
Subject Writing some code after ApacheConEU - Retrieving SNAPSHOT Artifacts
Date Thu, 03 May 2007 13:02:03 GMT
Actually, I'm still there! :-)

I am trying to use Ivy 2.0.0a1 to download snapshot artifacts from a
M2 repository. I'm doing this from my own application, directly
talking to the Ivy API. Like this:

    public static void main(String[] args) throws Exception
        IvySettings settings = new IvySettings();

        ResolveEngine engine = new ResolveEngine(settings, new
EventManager(), new SortEngine(settings));

        File cache = new File("build/cache");

        ResolveData data = new ResolveData(engine, new
ResolveOptions().setCache(CacheManager.getInstance(settings, cache)));


        String ibiblioRoot = "";

        IBiblioResolver resolver = new IBiblioResolver();

        ModuleRevisionId mrid =
ModuleRevisionId.newInstance("org.mortbay.jetty", "cometd-demo",
        ResolvedModuleRevision rmr = resolver.getDependency(new
DefaultDependencyDescriptor(mrid, false), data);

        DefaultArtifact artifact = new DefaultArtifact(mrid,
rmr.getPublicationDate(), "cometd-demo", "war", "war");
        DownloadReport report = Artifact[]
{artifact}, new DownloadOptions(settings, cache));

This basically comes out of the IBiblioResolverTest.

This works ok for retrieving artifacts that have a release version in
the repository, for example commons-fileupload 2.0. But it does not
work for -SNAPSHOT versions like the above cometd-demo 6.1-SNAPSHOT.

I've browsed through the Ivy code and it looks like it does not touch
the maven-metadata.xml file in the repository to find the latest

Is this something that Ivy simply does not support yet, or am I not
using the API in the right way?


View raw message