Maven POM 依赖于 ivy.xml 文件

发布于 2024-09-19 13:18:39 字数 64 浏览 3 评论 0原文

是否有一个 Maven 插件可以用来将 Maven pom 依赖项(包括传递依赖项)转换为 ivy.xml 文件?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

遗失的美好 2024-09-26 13:18:39

这是

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

来自 此处此处(可能在其他地方)

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)

扶醉桌前 2024-09-26 13:18:39

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

只需要一行,如 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>

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.

Just one line is required as specified in 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>
ま柒月 2024-09-26 13:18:39

根据 Ivy 1.3-RC1 变更日志

新:maven2 pom 兼容性:大多数
解析器现在能够处理 m2
pom 作为项目元数据,并且有一个
新的 Convertpom 任务能够转换
pom 文件转换为 ivy 文件 (IVY-140)

在此博文中对此转换进行了解释。 。

我知道这不是专家,而是常春藤方面,但无论如何它似乎存在一些东西,不是吗?
“应该”可以转换代码(可在网络上获取< /a>) 到一个 Maven 插件,以便由 Maven 指导此转换,如果您愿意的话。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文