apache / apache/maven

[MNG-5404] Wrong resolution of dependency scope by Maven 3

Open
#6,521 7 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

**[Dmitry Batrak](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=batrdmi)** opened **[MNG-5404](https://issues.apache.org/jira/browse/MNG-5404?redirect=false)** and commented

For the following POM:

```

4.0.0

test
A
1.0



org.apache.axis2
axis2-xmlbeans
1.5
provided


org.apache.axis2
axis2-codegen
1.5


org.apache.geronimo.specs
geronimo-stax-api_1.0_spec





```

running 'mvn dependency:resolve' using Maven 3.0.4 yields a wrong result.
Namely, geronimo-stax-api_1.0_spec dependency is reported as having the resolved scope of 'compile'. With Maven 2.2.1 I get the 'provided' scope, as expected.

Debug log is attached.

---

**Affects:** 3.0.4

**Attachments:**
- [build.log](https://issues.apache.org/jira/secure/attachment/12713227/build.log) (_21.22 kB_)
- [compile-as-transitive-of-provided.tgz](https://issues.apache.org/jira/secure/attachment/12781949/compile-as-transitive-of-provided.tgz) (_15.96 kB_)
- [example.zip](https://issues.apache.org/jira/secure/attachment/12712763/example.zip) (_402 bytes_)

**Issue Links:**
- [MNG-5622](https://issues.apache.org/jira/browse/MNG-5622) Provided dependencies updated to 'compile' even when excluded

**Backported to:** [needing-scrub-3.4.0-fallout](https://github.com/apache/maven/milestone/90?closed=1)

2 votes, 7 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.