You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Ilya Serbis (Jira)" <ji...@apache.org> on 2021/03/03 18:48:00 UTC
[jira] [Comment Edited] (MNG-7091) Exclusions in test scope seem to
affect compile scope
[ https://issues.apache.org/jira/browse/MNG-7091?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17294735#comment-17294735 ]
Ilya Serbis edited comment on MNG-7091 at 3/3/21, 6:47 PM:
-----------------------------------------------------------
Note that previous version of the {{maven-dependency-plugin}} gives identical and correct results for both cases:
{code:java}
mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:tree -Dverbose=true{code}
was (Author: serdis):
Note that previous version of the {{maven-dependency-plugin}} gives identical and correct result for both cases:
{code:java}
mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:tree -Dverbose=true{code}
> 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
> Priority: Major
>
> It seems that dependency exclusions in the pom of a third-party library affect the dependencies of the application that uses that library, 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)