[jira] Created: (MDEP-152) Analyze main and test dependencies separately
Analyze main and test dependencies separately
URL: http://jira.codehaus.org/browse/MDEP-152 Project: Maven 2.x Dependency Plugin
Issue Type: Improvement
Affects Versions: 2.0
Reporter: Benjamin Bentmann
Assignee: Brian Fox
The current design of the maven-dependency-analyzer is mixing apples and oranges. If a POM declares an artifact as a compile time dependency but actually only requires it for test execution, the analysis would be fine because the analyzer ignores scopes.
Therefore, I suggest to split the analysis and its report into:
- used declared main dependencies
- used undeclared main dependencies
- unused declared main dependencies
- used declared test dependencies
- used undeclared test dependencies
- unused declared test dependencies
Analysis of the main dependencies would only include "target/classes" and artifacts with scope "compile"/"system"/"provided" (similar but not equal to ignoreNonCompile=true). Analysis of the test dependencies would consider "target/test-classes" and all available artifacts. As a special case, the group "unused declared test dependencies" should be post-processed by removing all artifacts whose scope is not "test". Otherwise, many of the main artifacts would be reported here.
Finally, a new parameter "excludeTest" should allow to skip the analysis of test dependencies.