I typically just add an <exclusion> for one of my top level dependency, so Maven picks from some other.
Lockfile builds are also deterministic. You only break that determinism if you change the lockfile.
Re:We shouldn't have needed lockfiles
by javanonymous on Wednesday August 06, 2025 @04:44PM
(#44817599)
You can use version range with a maven plugin
https://maven.apache.org/enforcer/enforcer-rules/versionRang...
That's precisely because maven doesn't support version ranges. Maven artifacts are also immutable.
Maven also supports manual override when the insane resolution strategy fails that's the "dependencymanagement" section.