You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Alireza Ghassemi (Jira)" <ji...@apache.org> on 2019/09/02 11:38:00 UTC

[jira] [Comment Edited] (MNG-6663) overriding parent dependency management doesn't work for transitive dependencies

    [ https://issues.apache.org/jira/browse/MNG-6663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16920792#comment-16920792 ] 

Alireza Ghassemi edited comment on MNG-6663 at 9/2/19 11:37 AM:
----------------------------------------------------------------

[~belingueres]

I updated the [^pom.xml] with your suggestion but it results in:

[INFO] — maven-dependency-plugin:3.1.1:tree (default-cli) @ kotlin-test —
 [INFO] foo.bar:kotlin-test:jar:1.0-SNAPSHOT
 [INFO] - org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.3.50:compile
 [INFO] +- org.jetbrains.kotlin:kotlin-stdlib:jar:1.2.71:compile
 [INFO] | +- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.3.50:compile
 [INFO] | - org.jetbrains:annotations:jar:13.0:compile
 [INFO] - org.jetbrains.kotlin:kotlin-stdlib-jdk7:jar:1.2.71:compile

so that doesn't fix this, it seems.


was (Author: ravenblackdusk):
[~belingueres]

I updated the [^pom.xml] with your suggestion but it results in:

[INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @ kotlin-test ---
[INFO] foo.bar:kotlin-test:jar:1.0-SNAPSHOT
[INFO] \- org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.3.50:compile
[INFO] +- org.jetbrains.kotlin:kotlin-stdlib:jar:1.2.71:compile
[INFO] | +- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.3.50:compile
[INFO] | \- org.jetbrains:annotations:jar:13.0:compile
[INFO] \- org.jetbrains.kotlin:kotlin-stdlib-jdk7:jar:1.2.71:compile

> overriding parent dependency management doesn't work for transitive dependencies
> --------------------------------------------------------------------------------
>
>                 Key: MNG-6663
>                 URL: https://issues.apache.org/jira/browse/MNG-6663
>             Project: Maven
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 3.6.1
>            Reporter: Alireza Ghassemi
>            Priority: Major
>         Attachments: pom.xml, pom.xml
>
>
> overriding the dependencies of a parent POM is possible by setting the dependency version explicitly in the child POM which makes sense; since a parent POM is "suggesting" dependency versions for children that don't know which version to use and a child that knows exactly which version they need can ignore their parents "suggestion". however that is not the case for transitive dependencies of the dependency explicitly versioned in the child.
> example POM:
> [^pom.xml]
> mvn dependency:tree output:
> [INFO] foo.bar:kotlin-test:jar:1.0-SNAPSHOT
>  [INFO] - org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.3.31:compile
>  [INFO]    +- org.jetbrains.kotlin:kotlin-stdlib:jar:1.2.71:compile
>  [INFO]    |  +- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.2.71:compile
>  [INFO]    |  - org.jetbrains:annotations:jar:13.0:compile
>  [INFO]    - org.jetbrains.kotlin:kotlin-stdlib-jdk7:jar:1.2.71:compile
> expected:
> [INFO] foo.bar:kotlin-test:jar:1.0-SNAPSHOT
>  [INFO] - org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.3.31:compile
>  [INFO]    +- org.jetbrains.kotlin:kotlin-stdlib:jar:1.3.31:compile
>  [INFO]    |  +- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.3.31:compile
>  [INFO]    |  - org.jetbrains:annotations:jar:13.0:compile
>  [INFO]    - org.jetbrains.kotlin:kotlin-stdlib-jdk7:jar:1.3.31:compile
>  
> since 'kotlin-stdlib-jdk8:1.3.31' was compiled with 'kotlin-stdlib:1.3.31' runtime exceptions will happen; yet nobody needs 'kotlin-stdlib:1.2.71'



--
This message was sent by Atlassian Jira
(v8.3.2#803003)