[ https://issues.apache.org/jira/browse/MNG-5971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15153978#comment-15153978 ]
Robert Scholte commented on MNG-5971: ------------------------------------- Introducing a new scope in modelVersion 4.0.0 is a recipe for disaster. If this scope ends up in a dependency or parent, you cannot force a specific Maven version anymore. Any new feature on the current pom must be ported back to a structure that is supported to all tools using the pom. {quote} This very issue is about the fact that adding the dependency directly works, adding a bom that defines said dependency doesn't. IMO this is inconsistent considering how we're using BOM (= share a dependency management section). {quote} Yes, this is what I would expect as well. I've read the complete thread and I'm missing a couple of fundamental statements: as a writer of a parent I must be able to decide if my proposed versions are final or are just defaults. One of the purposes of dependencyManagement was to set versions on a higher level and ignore the version of dependencies on a lower level. In this case dependencyManagement should work as a safetynet. So we want to use a BOM to specify default which doesn't work, but as direct dependency it does. This seems a valid usecase to solve with the flatten-maven-plugin. We can use the different behavior of imported dependencies and direct dependencies and go from imported to direct with the flatten-maven-plugin. Slowly there are coming more and more usecases which require the build-pom to be a bit different compared to the distribution-pom. That's something we need to work on. In conclusion: -1 for this new scope! > Imported dependencies should be available to inheritance processing > ------------------------------------------------------------------- > > 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 > Assignee: Christian Schulte > Priority: Trivial > > 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)