简体   繁体   English

常春藤间接依赖性列出两次

[英]Ivy Indirect Dependency Listed Twice

My classpath contains two different versions of an indirect dependency and I do not understand why. 我的类路径包含两个不同版本的间接依赖项,我不明白为什么。

My sub-project ("myJar") depends on a "utils" sub-project that depends on "lib-subprojA". 我的子项目(“myJar”)依赖于依赖于“lib-subprojA”的“utils”子项目。 I have the code to all these projects, but they are proprietary, so I cannot post snippets. 我有所有这些项目的代码,但它们是专有的,所以我不能发布片段。

myProject-myJar -> myProject-utils -> lib-subprojA

I made a change in lib-subprojA; 我对lib-subprojA进行了更改; the last version before the change was 0.0.100-SNAPSHOT. 更改前的最后一个版本是0.0.100-SNAPSHOT。 The version that contains my change is 0.0.101-SNAPSHOT. 包含我的更改的版本是0.0.101-SNAPSHOT。 When I look at the classpath of "myProject-myJar" I find both "lib-subprojA-0.0.100-SNAPSHOT.jar" (the old version) and "lib-subprojA-0.0.101-SNAPSHOT.jar" (the latest version). 当我查看“myProject-myJar”的类路径时,我发现“lib-subprojA-0.0.100-SNAPSHOT.jar”(旧版本)和“lib-subprojA-0.0.101-SNAPSHOT.jar”(最新版本)版)。 Not sure why both are in classpath, but I cannot get "myProject-myJar" to compile because it uses old version of "lib-subprojA". 不知道为什么两者都在classpath中,但是我无法编译“myProject-myJar”,因为它使用了旧版本的“lib-subprojA”。

This happens in Eclipse (with IvyDE) and sbt ( sbt clean update compile ). 这发生在Eclipse(使用IvyDE)和sbt( sbt clean update compile )中。 I have no idea why resolving the middle project ("myProject-utils") produces the correct dependency while resolving the leaf project ("myProject-myJar") brings in two versions of the same JAR ("lib-subprojA", versions 0.0.100, 0.0.101). 我不知道为什么解析中间项目(“myProject-utils”)会产生正确的依赖关系,而解析叶子项目(“myProject-myJar”)带来两个版本的相同JAR(“lib-subprojA”,版本0.0。 100,0.0.101)。

Is this because intermediate resolution results are cached? 这是因为中间分辨率结果被缓存了吗? If so, how can I delete that cache? 如果是这样,我该如何删除该缓存?

lib-subprojA // Made change here. Old version: 0.0.100; new: 0.0.101
lib-subprojB
myProject-utils: dependency ... name="lib-subprojA"    rev="0.0.+" conf="compile->compile(*),master(*);runtime->runtime(*)"
  resolves to: lib-subprojA-0.0.101-SNAPSHOT.jar
myProject-myJar: dependency ... name="myProject-utils" rev="0.0.+" conf="compile->compile(*),master(*);runtime->runtime(*)"
  resolves to: lib-subprojA-0.0.100-SNAPSHOT.jar, lib-subprojA-0.0.101-SNAPSHOT.jar

It turns out that in one of the config files for lib-subprojA we had set local.ivy.dir to ${user.home}/ivy2 instead of ${user.home}/.ivy2 . 事实证明,在lib-subprojA的一个配置文件中,我们将local.ivy.dir设置为${user.home}/ivy2而不是${user.home}/.ivy2 I have spent a few hours tracking a single period character, no bigger than this: . 我花了几个小时跟踪一个时期的角色,不比这更大: .

It all works as expected now. 这一切现在按预期工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM