[英]How do I solve Multiple artifacts of the module X are retrieved to the same file in Apache Ivy?
[英]Multiple artifacts of the module X are retrieved to the same file in Apache Ivy?
使用 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)
我按照這篇文章設置了配置:
<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>
ivy.xml 中的 commons-codec 依賴項如下所示:
<dependency org="commons-codec" name="commons-codec" rev="1.10" conf="*->default" />
有人能告訴我我做錯了什么嗎?
將配置名稱( conf
)添加到檢索模式,以便屬於多個配置( default
和test
,...)的依賴項映射到不同的目錄:
<ivy:retrieve pattern="${build.lib.dir}/[conf]/[artifact]-[type]-[revision].[ext]" symlink="false" log="quiet"/>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.