从 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 存储库时效果很好。但是今天我无法执行&lt;ivy:retrieve&gt; 任务,因为它找不到com.caucho#hessian#3.2.1

&lt;ivy:report&gt;任务说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" 会被忽略的主要内容,如果未能解决你的问题,请参考以下文章

解决常春藤中的maven test-jar

将发送到常春藤的罐子发布到 Nexus

如何使用 ivy 和 nexus 发布 3rdparty 工件

Nexus Ivy Maven:二级依赖忽略传递

常春藤下载的罐子比预期的要多

常春藤从常春藤缓存中删除不需要的(旧)工件