apache / apache/maven

[MNG-5197] locally declared test dependency's first-generation transitive dependency version incorrectly overrides (n > 1)th-generation compile-scoped dependency version

Open
#6,991 3 comments 0 reactions 0 assignees View on GitHub
bug priority:major
Dominant language
Java
Stars
5.3k
Forks
3.1k
Avg merge
20h 42m
Merged PRs (30d)
297

Description

**[Matthew Jason Benson](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=mbenson)** opened **[MNG-5197](https://issues.apache.org/jira/browse/MNG-5197?redirect=false)** and commented

This bug seems to relate to MNG-4457, MNG-4156, and potentially others, but I have opened a new issue since nothing I found while searching could be described in precisely the same way.

The test project I am attaching defines three modules:
thing1
thing2
thing3

thing1 depends on hamcrest-core 1.2
thing2 depends on thing1 and junit 4.10
thing3 depends on thing2 and junit 4.10

If you install these, you can then view the dependency trees for thing2 and thing3 and see that thing1 correctly resolves v1.2 for hamcrest-core. thing3, however, apparently overrides the version back to 1.1, apparently accessed transitively via junit.

Thanks to Mark Struberg for his help in isolating this behavior!

---

**Affects:** 2.2.1, 3.0.3

**Attachments:**
- [test-versions.tar.gz](https://issues.apache.org/jira/secure/attachment/12712691/test-versions.tar.gz) (_1.60 kB_)

**Issue Links:**
- [MNG-3890](https://issues.apache.org/jira/browse/MNG-3890) Transitive dependencies override explicitly set scope.

1 votes, 3 watchers

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.