Maven POM依赖于ivy.xml文件

时间:2022-11-08 23:57:59

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

是否有一个maven插件,我可以使用它来转换maven pom依赖项,包括传递依赖项到ivy.xml文件?

3 个解决方案

#1


5  

Here's an Ant script

这是一个Ant脚本

<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)

从这里或这里(可能在其他地方)

#2


4  

I feel it is better to depend solely on apache as much as possible. So here is the ant build file which I ran successfully.

我觉得最好尽可能多地依赖apache。所以这是我成功运行的ant构建文件。

Just one line is required as specified in http://ant.apache.org/ivy/history/trunk/use/convertpom.html.

根据http://ant.apache.org/ivy/history/trunk/use/convertpom.html中的说明,只需要一行。

<project
  name="convertPomToIvy"
  basedir="." default="all"
  xmlns:ivy="antlib:org.apache.ivy.ant">

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

#3


1  

According to Ivy 1.3-RC1 Changelog

根据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)

新:maven2 pom兼容性:大多数解析器现在能够处理m2 pom作为项目元数据,并且有一个新的convertpom任务能够将pom文件转换为常春藤文件(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.

我知道它不是maven,而是Ivy方面,但无论如何它似乎存在一些东西,不是吗?如果你愿意,它“应该”可以将代码(在网络上可用)转换为maven插件,以便由maven定向。

#1


5  

Here's an Ant script

这是一个Ant脚本

<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)

从这里或这里(可能在其他地方)

#2


4  

I feel it is better to depend solely on apache as much as possible. So here is the ant build file which I ran successfully.

我觉得最好尽可能多地依赖apache。所以这是我成功运行的ant构建文件。

Just one line is required as specified in http://ant.apache.org/ivy/history/trunk/use/convertpom.html.

根据http://ant.apache.org/ivy/history/trunk/use/convertpom.html中的说明,只需要一行。

<project
  name="convertPomToIvy"
  basedir="." default="all"
  xmlns:ivy="antlib:org.apache.ivy.ant">

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

#3


1  

According to Ivy 1.3-RC1 Changelog

根据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)

新:maven2 pom兼容性:大多数解析器现在能够处理m2 pom作为项目元数据,并且有一个新的convertpom任务能够将pom文件转换为常春藤文件(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.

我知道它不是maven,而是Ivy方面,但无论如何它似乎存在一些东西,不是吗?如果你愿意,它“应该”可以将代码(在网络上可用)转换为maven插件,以便由maven定向。