You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Karl Heinz Marbaise (JIRA)" <ji...@apache.org> on 2017/10/20 09:06:00 UTC

[jira] [Commented] (MDEP-587) test-jar type is incorrectly translated to jar artifact when resolving dependencies

    [ https://issues.apache.org/jira/browse/MDEP-587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16212392#comment-16212392 ] 

Karl Heinz Marbaise commented on MDEP-587:
------------------------------------------

On the first glance I see your problem...this means that the maven-dependency-plugin must translate all existing combinations of packaging type into extension/classifier. The problem going this direction would be that for each existing plugin which defines a packaging for example maven-jar-plugin, maven-war-plugin, maven-ear-plugin, or maven-jlink-plugin or rpm-maven-plugin etc. those translations must be put into the maven-dependency-plugin to work correctly...I'm not sure if this would be a good idea to do so...an excerpt of existing translations is documented here http://maven.apache.org/ref/current/maven-core/artifact-handlers.html but for rpm-maven-plugin and maven-jlink-plugin it is not there...

If you use the correct combinations of {{groupId:artifactId:version:packaging:classifier}} like this:
{code}
mvn org.apache.maven.plugins:maven-dependency-plugin:3.0.2:copy -Dartifact=org.neo4j:neo4j-collections:3.3.0:jar:tests -DoutputDirectory=..
{code}


> test-jar type is incorrectly translated to jar artifact when resolving dependencies
> -----------------------------------------------------------------------------------
>
>                 Key: MDEP-587
>                 URL: https://issues.apache.org/jira/browse/MDEP-587
>             Project: Maven Dependency Plugin
>          Issue Type: Bug
>    Affects Versions: 3.0.0, 3.0.1, 3.0.2
>            Reporter: Michael O'Connor
>
> When attempting to download a test-jar artifact there seems to be an error in how the artifact coordinates get translated. I think, for example, that {code}foo:bar:1.0.0-SNAPSHOT:test-jar{code} should be translated to {code}foo:bar:1.0.0-SNAPSHOT:jar:tests{code} but instead the plugin is translating it to {code}foo:bar:1.0.0-SNAPSHOT:jar{code} which results in getting an incorrect artifact
> To test, I'll use a random artifact from central that has an uploaded tests jar
> {code}mvn org.apache.maven.plugins:maven-dependency-plugin:3.0.2:copy -Dartifact=org.neo4j:neo4j-collections:3.3.0:test-jar -DoutputDirectory=/tmp/{code} if you compare this to the size of the actual test jar and the production jar, (and also watch the url that it downloads from) it gets the wrong jar



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)