Why does dependency:list -DincludeScope=compile lists compile scope for transitive dependencies of test scope items

本秂侑毒 提交于 2020-01-15 03:12:42

问题


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

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

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.

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.


回答1:


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.



来源:https://stackoverflow.com/questions/17237281/why-does-dependencylist-dincludescope-compile-lists-compile-scope-for-transiti

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!