从 Nexus 下载时,常春藤的 transitive="false" 会被忽略
Posted
技术标签:
【中文标题】从 Nexus 下载时,常春藤的 transitive="false" 会被忽略【英文标题】:Ivy's transitive="false" gets simply ignored when downloading from Nexus 【发布时间】:2015-01-24 16:16:54 【问题描述】:在我们公司,我们正在将旧的 ivy 存储库迁移到 Nexus。
将我们自己的工件上传到 Nexus 后,我尝试下载一些项目的依赖项来测试设置,但我在 spring-web 上失败了。让我解释一下。
这里是 ivy-settings.xml 文件,仅指向我们本地的 Nexus 安装
<?xml version="1.0" encoding="ISO-8859-1"?>
<ivysettings>
<settings defaultResolver="default" />
<resolvers>
<ibiblio name="nexus" m2compatible="true" root="http://nexus.local/nexus/content/repositories/central/" />
<ibiblio name="our-nexus" m2compatible="true" root="http://nexus/nexus/content/repositories/repo" />
<chain name="default" returnFirst="true">
<resolver ref="our-nexus" />
<resolver ref="nexus" />
</chain>
</resolvers>
</ivysettings>
在我们的一个项目中,我们使用 Spring Web,但不是所有的依赖项,所以我声明
<dependency org="org.springframework" name="spring-web" rev="3.0.5.RELEASE" transitive="false" />
这在使用 Ivy 存储库时效果很好。但是今天我无法执行<ivy:retrieve>
任务,因为它找不到com.caucho#hessian#3.2.1
<ivy:report>
任务说spring-web需要这种版本的hessian3.2.11.RELEASE
但是我已经声明了transitive="false"
!!!
为什么它不起作用?我错过了什么/搞砸了什么?
【问题讨论】:
【参考方案1】:应该可以。我个人更喜欢配置映射。请尝试以下方法:
<dependency org="org.springframework" name="spring-web" rev="3.0.5.RELEASE" conf="default->master" />
更多详情见:
How can I include the Ivy dependency and none of its dependencies?【讨论】:
以上是关于从 Nexus 下载时,常春藤的 transitive="false" 会被忽略的主要内容,如果未能解决你的问题,请参考以下文章