问题
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