【问题标题】:Ivy conflict resolution: two libs need another lib in different version常春藤冲突解决:两个库需要不同版本的另一个库
【发布时间】:2014-04-29 04:15:05
【问题描述】:

我在同一个项目中使用 json-schema-validator 和 guava。当我尝试更新其中一个时,我遇到了 findbugs 的冲突,所以一个库被遗漏了。

工作版本是:

  • json-schema-validator 2.0.0
  • 番石榴13.0.1

两者都依赖于 findbugs 1.3.9

我想使用的版本:

  • json-schema-validator 2.2.1
  • 番石榴16.0.1

这里 json-schema-validator 需要 findbugs (jsr305) 2.0.1,guava 需要 findbugs 1.3.9。有没有办法解决这个问题?我的意思是我可以在我的项目中使用 json-schema-validator 版本 2.2.1 和 guava 16.0.1。

示例文件:

构建.xml

<project name="example" default="download"
         xmlns:ivy="antlib:org.apache.ivy.ant">
  <target name="download" description="resolve dependencies with ivy">
    <ivy:resolve />
    <ivy:retrieve sync="true" type="jar"/>
  </target>
</project>

ivy.xml,工作中

<?xml version="1.0" encoding="ISO-8859-1"?>
 <ivy-module version="2.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
    <info organisation="example" module="example" status="integration">
    </info>
    <dependencies>
         <dependency org="com.github.fge" name="json-schema-validator" rev="2.0.0" />
         <dependency org="com.google.guava" name="guava" rev="13.0.1" />
    </dependencies>
 </ivy-module>

ivy.xml,不工作

<?xml version="1.0" encoding="ISO-8859-1"?>
 <ivy-module version="2.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
    <info organisation="example" module="example" status="integration">
    </info>
    <dependencies>
         <dependency org="com.github.fge" name="json-schema-validator" rev="2.2.1" />
         <dependency org="com.google.guava" name="guava" rev="16.0.1" />
    </dependencies>
 </ivy-module>

驱逐通知:

[ivy:resolve]   :: evicted modules:
[ivy:resolve]   com.google.code.findbugs#jsr305;1.3.9 by [com.google.code.findbugs#jsr305;2.0.1] in [default]

【问题讨论】:

标签: java ivy


【解决方案1】:

@Julien 感谢您的提示,根据那里的示例,我将检索行更改为

<ivy:retrieve pattern="lib/[artifact]-[revision].[ext]" sync="true"/>

现在可以使用了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-11-30
    • 2012-06-12
    • 2015-11-26
    • 2013-05-31
    • 2012-02-13
    • 1970-01-01
    • 2011-04-12
    相关资源
    最近更新 更多