如何解决模块X的多个工件被检索到Apache Ivy中的同一文件?

我使用ANT将我的东西部署到Tomcat。 但我错过了依赖关系,我想添加Ivy,因为它被推荐了。

现在我将它添加到我的build.xml文件中:

                         

这是我的ivy.xml:

       

这是我的日志:

 Buildfile: C:\Users\Jansu\workspace\HelloWorld\build.xml download-ivy: [get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.2.0/ivy-2.2.0.jar [get] To: C:\Users\Jansu\.ant\lib\ivy-2.2.0.jar [get] Not modified - so not downloaded init-ivy: update: [ivy:retrieve] :: Ivy 2.2.0 - 20100923230623 :: http://ant.apache.org/ivy/ :: [ivy:retrieve] :: loading settings :: url = jar:file:/C:/Users/Jansu/.ant/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings.xml [ivy:retrieve] :: resolving dependencies :: org.apache#hello-ivy;working@Jansu-PC [ivy:retrieve] confs: [default] [ivy:retrieve] found commons-lang#commons-lang;2.1 in public [ivy:retrieve] downloading http://repo1.maven.org/maven2/commons-lang/commons-lang/2.1/commons-lang-2.1.jar ... [ivy:retrieve] ................................................................................................................................................................................................................................................................................................................................................................................................................. (202kB) [ivy:retrieve] .. (0kB) [ivy:retrieve] [SUCCESSFUL ] commons-lang#commons-lang;2.1!commons-lang.jar (1704ms) [ivy:retrieve] downloading http://repo1.maven.org/maven2/commons-lang/commons-lang/2.1/commons-lang-2.1-sources.jar ... [ivy:retrieve] ........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................ (255kB) [ivy:retrieve] .. (0kB) [ivy:retrieve] [SUCCESSFUL ] commons-lang#commons-lang;2.1!commons-lang.jar(source) (1819ms) [ivy:retrieve] downloading http://repo1.maven.org/maven2/commons-lang/commons-lang/2.1/commons-lang-2.1-javadoc.jar ... [ivy:retrieve] ......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... [ivy:retrieve] ................................................................................................................................................................................................................................................................ (518kB) [ivy:retrieve] .. (0kB) [ivy:retrieve] [SUCCESSFUL ] commons-lang#commons-lang;2.1!commons-lang.jar(javadoc) (2817ms) [ivy:retrieve] :: resolution report :: resolve 2094ms :: artifacts dl 6357ms --------------------------------------------------------------------- | | modules || artifacts | | conf | number| search|dwnlded|evicted|| number|dwnlded| --------------------------------------------------------------------- | default | 1 | 1 | 1 | 0 || 3 | 3 | --------------------------------------------------------------------- [ivy:retrieve] :: retrieving :: org.apache#hello-ivy [ivy:retrieve] confs: [default] 

这是错误:

 BUILD FAILED C:\Users\Jansu\workspace\HelloWorld\build.xml:177: impossible to ivy retrieve: java.lang.RuntimeException: problem during retrieve of org.apache#hello-ivy: java.lang.RuntimeException: Multiple artifacts of the module commons-lang#commons-lang;2.1 are retrieved to the same file! Update the retrieve pattern to fix this error. Total time: 11 seconds 

似乎错误来自这种模式? :

  

但它看起来很坚固。

有什么建议么?

您必须扩展模式以包含类型,以便每个工件获取它自己的本地文件:

  

或者,如果您不需要源和javadoc,则可以将依赖项更改为:

       

这只会检索依赖项的master-conf(jar)。