Introduce options similar to allowMajorUpdates and allowMinorUpdates in maven versions plug-in
dpolivaev opened this issue · 1 comments
Sometimes major updates require update of Java runtime version or introduce other breaking changes and therefore they are not always possible.
See https://www.mojohaus.org/versions/versions-maven-plugin/update-property-mojo.html#allowMajorUpdates
Relates to #841
You can do this today using a resolutionStrategy. That offers more control as you can inspect the current version and the candidate selection. There is the short form below and an expanded block where you can specify the reject reason for different dependencies.
tasks.withType<DependencyUpdatesTask> {
rejectVersionIf {
candidate.version.substringBefore(".") != currentVersion.substringBefore(".")
}
}
The version strings in the ecosystem varies and some do not follow Maven's version conventions or semver. For example, I've seen some use even / odd version numbers to denote stable and beta releases. Instead we make sure you have the flexibility to define the logic for what your build needs, which likely will be mostly semver, but don't provide out-of-the-box that breaks and causes users wanting us to chase down bugs from 3rd parties.