apache / apache/maven-dependency-plugin
[MDEP-587] test-jar type is incorrectly translated to jar artifact when resolving dependencies
- Dominant language
- Java
- Stars
- 175
- Forks
- 196
- Avg merge
- 19h 30m
- Merged PRs (30d)
- 5
Description
**[Michael O'Connor](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=oconnormi)** opened **[MDEP-587](https://issues.apache.org/jira/browse/MDEP-587?redirect=false)** and commented
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 ```
foo:bar:1.0.0-SNAPSHOT:test-jar
```should be translated to
```foo:bar:1.0.0-SNAPSHOT:jar:tests
``` but instead the plugin is translating it to
```foo:bar:1.0.0-SNAPSHOT:jar
``` which results in getting an incorrect artifact
To test, I'll use a random artifact from central that has an uploaded tests jar
```
mvn org.apache.maven.plugins:maven-dependency-plugin:3.0.2:copy -Dartifact=org.neo4j:neo4j-collections:3.3.0:test-jar -DoutputDirectory=/tmp/
```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
```
---
**Affects:** 3.0.0, 3.0.1, 3.0.2
1 votes, 3 watchers
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by running the provided Maven dependency-plugin command and compare the downloaded URL and artifact size with the actual test JAR. Trace how the plugin translates the test-jar coordinate into artifact coordinates; done means it resolves foo:bar:1.0.0-SNAPSHOT:test-jar as the jar artifact with the tests classifier rather than the production JAR.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100