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)" <ian.dickin...@hp.com>
Subject Help with downloading source from local maven2
Date Tue, 10 Feb 2009 14:31:37 GMT
Hi,
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:

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

My ivy.xml says:

<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
  <info
        organisation="com.hp.imc"
        module="${name}"
        status="${version}">
  </info>
  <configurations defaultconfmapping="main->*">
    <conf name="main" description="${Name}" />
    <conf name="dev"  description="${Name} development" extends="main" />
  </configurations>

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

</ivy-module>

And my ant task says:

  <target name="ivy-collect-jars" depends="" description="Use Ivy to collect jars from
Maven">
    <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]" />
  </target>

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!

Thanks,
Ian


____________________________________________________________
Ian Dickinson     http://www.hpl.hp.com/people/ian_dickinson
HP Laboratories Bristol          mailto:ian.dickinson@hp.com
Hewlett-Packard Limited        Registered No: 690597 England
Registered Office:      Cain Road, Bracknell, Berks RG12 1HN
Mime
View raw message