【问题标题】:Multiple artifacts of the module X are retrieved to the same file in Apache Ivy?模块 X 的多个工件被检索到 Apache Ivy 中的同一个文件?
【发布时间】:2018-08-03 17:42:50
【问题描述】:

使用 ant 构建时出现以下错误:

BUILD FAILED
/Users/rajeevprasanna/Desktop/Nutch/nutch-release-1.14/build.xml:116: The following error occurred while executing this line:
/Users/rajeevprasanna/Desktop/Nutch/nutch-release-1.14/src/plugin/build.xml:34: The following error occurred while executing this line:
/Users/rajeevprasanna/Desktop/Nutch/nutch-release-1.14/src/plugin/build-plugin.xml:230: impossible to ivy retrieve: java.lang.RuntimeException: problem during retrieve of org.apache.nutch#lib-selenium: java.lang.RuntimeException: Multiple artifacts of the module commons-codec#commons-codec;1.10 are retrieved to the same file! Update the retrieve pattern  to fix this error.
    at org.apache.ivy.core.retrieve.RetrieveEngine.retrieve(RetrieveEngine.java:206)
    at org.apache.ivy.Ivy.retrieve(Ivy.java:540)
    at org.apache.ivy.ant.IvyRetrieve.doExecute(IvyRetrieve.java:59)
    at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:277)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)

我已经按照 post 设置了配置:

<target name="resolve-default" depends="clean-default-lib" description="--> resolve and retrieve dependencies with ivy">
    <ivy:resolve file="${ivy.file}" conf="default" log="download-only"/>
    <ivy:retrieve pattern="${build.lib.dir}/[artifact]-[type]-[revision].[ext]" symlink="false" log="quiet"/>
    <antcall target="copy-libs"/>
  </target>

  <target name="resolve-test" depends="clean-test-lib, init" description="--> resolve and retrieve dependencies with ivy">
    <ivy:resolve file="${ivy.file}" conf="test" log="download-only"/>
    <ivy:retrieve pattern="${test.build.lib.dir}/[artifact]-[type]-[revision].[ext]" symlink="false" log="quiet"/>
    <antcall target="copy-libs"/>
  </target>

commons-codec 依赖如下 ivy.xml :

<dependency org="commons-codec" name="commons-codec" rev="1.10" conf="*->default" />

谁能告诉我我做错了什么?

【问题讨论】:

  • 您是否需要将所有配置文件映射到您的default
  • Rajeev,你能解决这个问题吗?我被困在同一个地方。

标签: java build ant ivy


【解决方案1】:

将配置名称(conf)添加到检索模式中,以便属于多个配置(defaulttest,...)的依赖项映射到不同的目录:

<ivy:retrieve pattern="${build.lib.dir}/[conf]/[artifact]-[type]-[revision].[ext]" symlink="false" log="quiet"/>

【讨论】:

    猜你喜欢
    • 2011-11-09
    • 1970-01-01
    • 2017-07-06
    • 2015-08-22
    • 1970-01-01
    • 2012-07-24
    • 2011-05-26
    • 2014-08-20
    • 2014-04-12
    相关资源
    最近更新 更多