0

Why mvnrepository.com or nexus does not follow a convention to have a latest version, for example:

<dependency>
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
    <version>latest</version>
</dependency>

The version latest will always point to the latest version in the repository so instead of updating the pom.xml file, during the build, it will pick the latest on. Provided the library is backward compatible.

Vishrant
  • 15,456
  • 11
  • 71
  • 120
  • 2
    It is difficult to answer 'why' type of questions. I believe that non-reproducible builds are to be avoided, and the feature you propose is harmful in the long run (example: I've been bitten by inconsistent builds and non-backward compatible updates in docker, that provides such feature). I guess maven maintainers share my point of view. – Lesiak Mar 27 '20 at 18:17
  • 1
    First `latest` will not work cause it is not defined that way. Furthermore as already mentioned reproducibility is the key point. Apart from that you don't know if a library will follow any kind of convention like semver etc but it does not change anything cause if you would use `latest` this could replace a version `1.2.3` with `2.1.0` which could break your whole code. Apart from all before there is no such convention using `latest` it's the same as using version ranges which should be avoided. You will get a warning if you use such things for a good reason. – khmarbaise Mar 27 '20 at 19:49
  • 1
    BTW: mvnrepository is no maven repository it's search engine... – khmarbaise Mar 27 '20 at 19:55

0 Answers0