maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Schulte (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MNG-5971) Dependency management in a child project cannot override a version using a BOM
Date Wed, 17 Feb 2016 15:52:18 GMT

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

Christian Schulte commented on MNG-5971:
----------------------------------------

To clarify further. You are referring to the following example setup taken from [Spring Boot
Quickstart|http://projects.spring.io/spring-boot/#quick-start]

{code}
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.3.2.RELEASE</version>
</parent>
<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
</dependencies>
{code}

What issue are you trying to solve? If a user adds something to the {{<dependencies>}}
or {{<dependencyManagement>}} sections leading to overriding something coming from {{org.springframework.boot:spring-boot-starter-parent}},
you want Maven to ignore that and use the parent data? Something along what the Java {{@Override}}
annotation or the {{final}} modifier would be used for? You need to flag a dependency {{final}}
in the parent so that it is not possible to override it down the hierarchy?

??that project need to override the version of one dependency provided in the parent and there
is no way in Maven to do that??

Just add that dependency to the correct "level" (here: the parent) where it will correctly
override things? Could you please explain what needs to be added to {{<dependencies>}}
or {{<dependencyManagement>}} to demonstrate the issue.

> Dependency management in a child project cannot override a version using a BOM
> ------------------------------------------------------------------------------
>
>                 Key: MNG-5971
>                 URL: https://issues.apache.org/jira/browse/MNG-5971
>             Project: Maven
>          Issue Type: Wish
>          Components: Dependencies
>    Affects Versions: 3.3.3
>            Reporter: Stephane Nicoll
>            Priority: Trivial
>              Labels: close-pending
>
> When a project extends from a parent with a {{dependencyManagement}} section, it is not
always possible to properly override (and align) the version to use for a group of dependencies.
> We typically use Bill Of Materials to gather a group of modules and make sure their versions
are consistent. 
> The following project demonstrates the issue: https://github.com/snicoll-scratches/maven-dependency-management
> The first commit is a working use case where the parent uses a bom with version A and
we use the same bom with version B in the child. Version B is used as expected.
> The second commit demonstrates the faulty scenario. Rather than using a bom in the parent,
we use a direct dependency (provided by that bom). We still use the bom with a different version.
In that case all the dependencies but the one provided by the parent are overridden (leading
to mixed versions for the dependencies provided by the BOM).
> It looks like the distance is still used to compute the version while the graph of dependencies
should be flatten at each step for a proper override. 
> Thoughts? Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message