0

Is there any option to tell Maven to start from latest version, when a version range needs to be evaluated? E.g. having

<version>[1.0.0,2.0.0)</version>

Maven starts with e.g. 1.0.0, 1.1.0, ..., 1.234.0.

For each of these version, Maven goes into all nested dependencies, which might also be version ranges, and recursively does again evaluations starting from their lowest version, running into exponential useless evaluation mess...

Is there any option to tell Maven to evaluate starting with latest version, and skip lower version evaluation if not required?

If 1.234.0 matches the needs, and nothing forces usage of a lower version, all earlier versions do not need to be evaluated at all.

Gradle reading Maving pom.xml's is able to resolve versions starting from latest version, and is much (!!!) faster than Maven. (I know from the time when Maven was designed and built, IBM forced that evaluation order for some reason, which was a really bad decision for the community in long-term.)

Is there any Maven mechanism to reverse the evaluation order and make Maven work in the same manner?

  • I don't know, but version ranges are usually discouraged. – J Fabian Meier Aug 27 '18 at 09:30
  • I only want Maven to use latest version for some specific dependency trees, where I need to use dependency ranges. For all others, it should not have any impact. Furthermore, the dependency range should NOT be replaced in the pom.xml, as I need to get the version re-evaluated each build. – Mick Belker - Pseudonym Aug 27 '18 at 13:18
  • First why are you using a version range in that case? Change the range if you know that the earlier versions should not be considered..Furthemore I'm also the opinion to prevent using version ranges.. / Apart from that how are you coming to the conclusion that IBM forced a decision of version range solving? Is there any evidence of that? Furthermore if you are the opinion Gradle is faster than why not using Gradle? – khmarbaise Aug 27 '18 at 14:02
  • What about calling something like `versions:use-latest-releases` (with specific includes) before the build? In this way, you can update the pom without using version ranges. – J Fabian Meier Aug 27 '18 at 14:54

0 Answers0