Description
The documentation of dependency:sources lists the parameters
- type http://maven.apache.org/plugins/maven-dependency-plugin/sources-mojo.html#type
- classifier http://maven.apache.org/plugins/maven-dependency-plugin/sources-mojo.html#classifier
This suggests that the mojo could be used to resolve other artifact types as well, a functionality that was requested today in this StackOverflow question: http://stackoverflow.com/q/4734407/342852
e.g.
mvn dependency:sources -Dclassifier=javadoc -Dtype=jar
But in the org.apache.maven.plugin.dependency.resolvers.ResolveDependencySourcesMojo source code, both parameters are manually overwritten with the constant values 'java-source' and 'sources', respectively.
this.classifier = SOURCE_CLASSIFIER; this.type = SOURCE_TYPE;
This is clearly in violation of the documented behavior. I suggest these assignments to be replaced with the following code:
if(StringUtils.isEmpty(this.classifier)){ this.classifier=SOURCE_CLASSIFIER; } if(StringUtils.isEmpty(this.type)){ this.type=SOURCE_TYPE; }
Attachments
Issue Links
- is related to
-
MDEP-205 type configuration ignored in sources goal
- Closed