views:

108

answers:

2

Is there a maven plugin which i can use to convert the maven pom dependencies including transitive dependencies to an ivy.xml file?

A: 

According to Ivy 1.3-RC1 Changelog

NEW: maven2 pom compatibility: most resolvers are now able to handle m2 pom as project metadata and there is a new convertpom task able to convert a pom file to an ivy file (IVY-140)

This transformation is explained with moire details in this blog post.

I known it's not the maven, but the Ivy side, but anyway it seems to exist something, no ? It "should" be possible to convert the code (available on the web) to a maven plugin to have this transformation directed by maven, if you wish so.

Riduidel
+1  A: 

Here's an Ant script

<project name="convertPomToIvy" basedir="." default="all"
  xmlns:ivy="antlib:fr.jayasoft.ivy.ant"
  xmlns:ac="antlib:net.sf.antcontrib">

    <path id="antlib.classpath">
        <fileset dir="/path/to/ivy/libs" includes="*.jar"/>
    </path>

    <taskdef uri="antlib:fr.jayasoft.ivy.ant"
        resource="fr/jayasoft/ivy/ant/antlib.xml"
        classpathref="antlib.classpath"
        loaderref="antlib.classpath.loader"/>

    <target name="convert">
        <ivy:convertpom pomFile="pom.xml" ivyFile="ivy.xml" />
    </target>

</project>

From here or here (& probably elsewhere)

Jon Freedman