mvn dependency:sources lists parameters 'classifier' and 'type', but manually overrides them --------------------------------------------------------------------------------------------
Key: MDEP-298 URL: http://jira.codehaus.org/browse/MDEP-298 Project: Maven 2.x Dependency Plugin Issue Type: Bug Affects Versions: 2.1 Reporter: Sean Patrick Floyd Assignee: Brian Fox 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. {code} mvn dependency:sources -Dclassifier=javadoc -Dtype=jar {code} 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. {code} this.classifier = SOURCE_CLASSIFIER; this.type = SOURCE_TYPE; {code} This is clearly in violation of the documented behavior. I suggest these assignments to be replaced with the following code: {code} if(StringUtils.isEmpty(this.classifier)){ this.classifier=SOURCE_CLASSIFIER; } if(StringUtils.isEmpty(this.type)){ this.type=SOURCE_TYPE; } {code} -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira