You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michel Schudel (Jira)" <ji...@apache.org> on 2021/02/01 13:52:00 UTC
[jira] [Created] (MNG-7091) Exclusions in test scope seem to affect
compile scope
Michel Schudel created MNG-7091:
-----------------------------------
Summary: Exclusions in test scope seem to affect compile scope
Key: MNG-7091
URL: https://issues.apache.org/jira/browse/MNG-7091
Project: Maven
Issue Type: Bug
Components: Dependencies
Affects Versions: 3.6.3
Reporter: Michel Schudel
It seems that dependency exclusions in the pom of a third-party library affect the dependencies of the application that uses that librarty, even when that third-party library is in test scope.
I've created a project at [https://github.com/MichelSchudel/example-project] that reproduces the problem. Below is the information from the readme.md that you can use to reproduce the issue.
This project showcases weird dependency behaviour as far as exclusions go.
There are two dependencies in this project:
* axual-platform-test-core (test scope)
* nimbus-jose-jwt
There is no additional source code, because we don't need it to showcase the issue.
When we comment out the {{axual-platform-test-core}} dependency, we get a dependency tree with three libs:
* nimbus-jose-jwt
* json-smart (dep of nimbus)
* accessors-smart (dep of nimbus)
When we undo the commen-out of "axual-platform-test-core" dependency, we get a dependency tree where the "json-smart" and "accessors-smart" deps have _dissappeared_ from the Nimbus tree and are only dependencies of the "axual-platform-test-core".
Looking at the pom of "axual-platform-test-core", it excludes "accessors-smart" from its "json-smart" dependency and replaces it with another version:
<dependency>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
<version>2.2.1</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>net.minidev</groupId>
<artifactId>accessors-smart</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.minidev</groupId>
<artifactId>accessors-smart</artifactId>
<version>1.1</version>
<scope>compile</scope>
The real issue here is: *why does this have an impact on the compile scope dependency tree of my application?* Since I'm only using {{axual-platform-test-core}} in _test_ scope, exclusions should have no impact on the _compile scope_, right?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)