reda-alaoui opened a new issue, #1084:
URL: https://github.com/apache/maven-enforcer/issues/1084
### New feature, improvement proposal
`requireUpperBoundDeps` makes sure a dependency's version is at least the
highest version requested in the dependency tree. Nothing stops a version set
in `dependencyManagement` from going beyond what any dependency asks for.
Suppose `org.example:lib-a` depends on `org.example:util:1.4` and
`org.example:lib-b` depends on `org.example:util:1.7`. As the rule's error
message suggests, the project adds `org.example:util:1.7` to
`dependencyManagement`. Later, a tool like Renovate or Dependabot bumps that
entry to `org.example:util:2.0`. The rule still passes, yet `lib-a` and `lib-b`
now run against a version neither of them asked for.
I propose an option that makes the rule fail when a managed version is above
every version the dependencies request:
```xml
<requireUpperBoundDeps>
<failWhenManagedVersionIsAboveRequested>true</failWhenManagedVersionIsAboveRequested>
</requireUpperBoundDeps>
```
It would only apply to versions the project manages itself, not to those
coming from an imported BOM. Dependencies the project declares directly would
be unaffected. A version kept higher on purpose, for example for a security
fix, can be listed in `excludes`.
I can provide a pull request with tests if the option is welcome.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]