为什么dependency:list -DincludeScope = compile列出测试作用域项目的传递依赖关系的编译作用域 [英] Why does dependency:list -DincludeScope=compile lists compile scope for transitive dependencies of test scope items

查看:478
本文介绍了为什么dependency:list -DincludeScope = compile列出测试作用域项目的传递依赖关系的编译作用域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

"mvn依赖项:列表-DincludeScope = compile"是否应包含测试范围部门的子依赖项?

Should "mvn dependency:list -DincludeScope=compile" include child dependencies of test scope deps?

我的项目取决于"org.apache.httpcomponents:httpclient:jar:4.1:测试" 和httpclient取决于"org.apache.httpcomponents:httpcore:jar:4.1:编译"

My project depends on "org.apache.httpcomponents:httpclient:jar:4.1:test" and httpclient depends on "org.apache.httpcomponents:httpcore:jar:4.1:compile"

如果我查看编译范围的依赖关系,我不希望在httpclient下方看到任何内容,因为它是测试范围,并且应该过滤掉依赖关系的分支.

If I look at compile scope dependencies, I do not expect to see anything below httpclient since it is test scope and that branch of dependencies should be filtered out.

但是,以下内容包含核心"列表httpcore

However, the following includes core" lists httpcore

mvn dependency:list -DincludeScope=compile -DexcludeScope=test|grep -i http.*core

[INFO]    org.apache.httpcomponents:httpcore:jar:4.1:compile

我的项目的依赖项:树输出

My Project's dependency:tree output

[INFO] +- org.apache.httpcomponents:httpclient:jar:4.1:test
[INFO] |  +- org.apache.httpcomponents:httpcore:jar:4.1:compile
[INFO] |  +- commons-logging:commons-logging:jar:1.1:test
[INFO] |  \- commons-codec:commons-codec:jar:1.4:compile

我错过了一个可以正确"处理该标志的标志吗?还是我误解了这种情况下的正确方法.

Am I missing a flag that handles this "properly" or am I misunderstanding what proper is in this situation.

推荐答案

哦,这是一个错误( http://jira.codehaus.org/browse/MNG-3089 )在此线程

Oh, it's a bug (http://jira.codehaus.org/browse/MNG-3089) explained in this thread http://www.mail-archive.com/dev@maven.apache.org/msg68011.html but not fixed.

这篇关于为什么dependency:list -DincludeScope = compile列出测试作用域项目的传递依赖关系的编译作用域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆