1

I have a project that I am implementing Ivy within, but it is not pulling down one dependency during an ivy:retrieve command.

ivy.xml exceprt:

    <dependency org="com.sun.jersey.contribs"   name="maven-wadl-plugin" rev="1.12" conf="support->default" >
        <!-- artifact name="maven-wadl-plugin" type="jar" /-->
        <exclude org="junit"                    module="junit" />
        <exclude org="org.apache.maven"         module="apache-maven" />
        <exclude org="org.apache.maven"         module="maven-artifact" />
        <exclude org="org.apache.maven"         module="maven-plugin-api" />
        <exclude org="xerces"                   module="xercesImpl" />
    </dependency>

I have tried with and without the 'excludes' to ensure I am not missing something, but when I remove the excludes it downloads more jars than are needed.

I use the maven-wadl-plugin.jar to generate a WADL for a rest application. I am just unsure exactly what is missing here but I have a feeling like there something very complex in the maven-wadl-plugin pom.xml and configurations.

Thanks for any help you can provide.

2 Answers2

0

If you only want the main artifact, without its transitive dependencies, then I recommend writing the ivy file as follows:

<dependencies>
    <dependency org="com.sun.jersey.contribs"   name="maven-wadl-plugin" rev="1.12" conf="support->master"/>
</dependencies>

The magic is the configuration mapping:

conf="support->master"

How configurations are mapped to Maven scopes is described in the following answer:

The special "master" remote configuration will have no dependencies, whereas "default" would pull down the additional compile dependencies.

Ivy dependency report

On a related matter, I recommend using the report task to generate a dependency report:

<target name="resolve" description="Use ivy to resolve classpaths">
    <ivy:resolve/>
    <ivy:report todir='build/ivy' graph='false' xml='false'/>
</target>

This will understand the relationship between the 42 additional files that were being downloaded with your original settings.

Community
  • 1
  • 1
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
  • I figured it out. The type was maven-plugin. Not a jar. This is why it would resolve but not retrieve. Thank you much mark for the info. – user2018819 Jan 29 '13 at 21:15
0

I figured it out. The type was maven-plugin. Not a jar. This is why it would resolve but not retrieve. Thank you much mark for the info.

In the build.xml I changed the ivy-retrieve as follows.

    <ivy:retrieve pattern="${support.dir}/[artifact]-[revision].[ext]" type="maven-plugin,jar,bundle" conf="support"/>

Thanks mark.