ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dickinson, Ian J. (HP Labs, Bristol, UK)" <>
Subject Help with downloading source from local maven2
Date Tue, 10 Feb 2009 14:31:37 GMT
I'm trying use Ivy to copy some files out of a local maven2 repository into a single directory,
so that they can feed in to another part of our process. I have three artifact files in my
~/.m2/repository: rdfutil-0.0.1-SNAPSHOT.jar, rdfutil-0.0.1-SNAPSHOT-sources.jar rdfutil-0.0.1-SNAPSHOT.pom.
The source was attached by the maven-source-plugin. The core issue is that I'm unable to retrieve
the sources jar.

My ivysettings.xml says:

  <settings defaultResolver="local-maven-2"/>
  <property name="local-maven2-pattern" value="${user.home}/.m2/repository/[organisation]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]"
override="false" />
    <filesystem name="local-maven-2" m2compatible="true" local="true">
      <ivy pattern="${local-maven2-pattern}"/>
      <artifact pattern="${local-maven2-pattern}"/>

My ivy.xml says:

<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0"
  <configurations defaultconfmapping="main->*">
    <conf name="main" description="${Name}" />
    <conf name="dev"  description="${Name} development" extends="main" />

    <dependency org="com.hp.eil" name="rdfutil" rev="latest.integration" transitive="false"


And my ant task says:

  <target name="ivy-collect-jars" depends="" description="Use Ivy to collect jars from
    <ivy:settings file="./ivysettings.xml" />
    <ivy:resolve conf="dev" haltonfailure="false" failureproperty="ivy.resolve.failed"
    <fail message="Ivy dependency failed" if="ivy.resolve.failed"/>
    <ivy:retrieve conf="dev"  pattern="./[module]-[revision](-[classifier]).[ext]" />

Doing this, the main jar is copied fine, but the sources jar is not. I'm obviously doing something
wrong, but I'm quite unable to see what. Any suggestions? In particular, if there's a better
way of doing it I wouldn't be surprised - I'm pretty new to Ivy and have cobbled the above
together from other peoples' examples and googling for solutions!


Ian Dickinson
HP Laboratories Bristol
Hewlett-Packard Limited        Registered No: 690597 England
Registered Office:      Cain Road, Bracknell, Berks RG12 1HN
View raw message