In a pom.xml, when specifying a dependency version, what is the difference between LATEST and [0,) ?
In my opinion they should be equivalent, but for some dependencies, LATEST does not match any version, whereas [0,) does.
In a pom.xml, when specifying a dependency version, what is the difference between LATEST
Share
In theory, LATEST is the latest released or snapshot version (see Rich Seller’s excellent answer on the special RELEASE and LATEST versions) so I would indeed expect the same behavior as with the
[0,)range. Out of curiosity, can you provide an example where LATEST doesn’t match?That being said, I don’t recommend using the LATEST nor RELEASE special versions as they make your build more fragile and harm the build reproducibility (you don’t really want your build to suddenly start to fail because of some uncontrolled update). Admittedly, they’re considered as a bad idea and references have been removed from the documentation (except from an untranslated part of the German version of the Definitive Guide)
and they are no longer supported in Maven 3.x.
You are thus strongly invited to not use them at all (bad practice, deprecated, not supported in the next version).
And I somehow consider the same applies to version ranges (in general), I don’t recommend them either as I wrote many times in previous answers or comments. See for example:
Follow-up after comment
I’m not 100% but I don’t think this artifact is providing the right
maven-metadata.xmlfor this feature to work. I think metadata should include<release>and<latest>elements like for maven plugins (see for example thismaven-metadata.xml). But I wouldn’t spend too much time on this for the aforementioned reasons, just forget thisLATESTstuff.