繁体   English   中英

Codenarc奇怪的依赖关系

[英]Codenarc strange dependencies

我们正在使用codenarc插件和gradle,我看到了依赖项中的奇怪之处:

codenarc - The CodeNarc libraries to be used for this project.
\--- org.codenarc:CodeNarc:0.25.2
 +--- junit:junit:4.8.1 -> 4.12
 |    \--- org.hamcrest:hamcrest-core:1.3
 +--- org.codehaus.groovy:groovy-xml:2.1.8 -> 2.6.0-alpha-1
 |    \--- org.codehaus.groovy:groovy:2.6.0-alpha-1
 +--- org.codehaus.groovy:groovy:2.1.8 -> 2.6.0-alpha-1
 +--- org.codehaus.groovy:groovy-ant:2.1.8 -> 2.6.0-alpha-1
 |    +--- org.codehaus.groovy:groovy:2.6.0-alpha-1
 |    +--- org.codehaus.groovy:groovy-groovydoc:2.6.0-alpha-1 -> 2.4.9
 |    |    +--- org.codehaus.groovy:groovy-templates:2.4.9
 |    |    |    +--- org.codehaus.groovy:groovy:2.4.9 -> 2.6.0-alpha-1
 |    |    |    \--- org.codehaus.groovy:groovy-xml:2.4.9 -> 2.6.0-alpha-1 (*)
 |    |    \--- org.codehaus.groovy:groovy:2.4.9 -> 2.6.0-alpha-1
 |    +--- org.apache.ant:ant-junit:1.9.9
 |    \--- org.apache.ant:ant-antlr:1.9.9
 \--- org.gmetrics:GMetrics:0.7
      +--- org.codehaus.groovy:groovy:[2.1.0,) -> 2.6.0-alpha-1
      +--- org.codehaus.groovy:groovy-xml:[2.1.0,) -> 2.6.0-alpha-1 (*)
      \--- org.codehaus.groovy:groovy-ant:[2.1.0,) -> 2.6.0-alpha-1 (*)

codenark的版本是0.25.2,在pom中它取决于groovy 2.1.8,但是wtf-为什么它链接到2.6.0-alpha-1? 我如何告诉Codenark使用Groovy 2.1.8版本?

感谢帮助。

正如您在输出中看到的,罪魁祸首是GMetrics。
CodeNarc 0.25.2取决于GMetrics 0.7,而后者又取决于Groovy 2.1.0或更高版本,后者解析为最新的可用版本2.6.0-alpha-1。
默认版本冲突解决策略是在发生冲突时使用最新版本,即2.6.0-alpha-1。

(以我的观点)库以动态范围发布是错误的。
GMetrics显然也将其视为错误,并在1.0中修复了此依赖关系,该依赖关系改为依赖特定的Groovy版本。
反过来,CodeNarc 1.0取决于GMetrics 1.0。

因此,如果可行,最简单的方法就是依赖CodeNarc 1.0,您的问题将消失。

另外,您也可以声明Groovy版本在您自己的依赖项中使用,使用force true强制将强制您定义的版本。

或者,您可以配置依赖性解析以影响所选的版本。

暂无
暂无

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

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