Maven has a version control system that selects the highest version of the library if multiple versions are referenced. For example, if pom A is version 1.1 and pom B is 1.2, then pom C (referring to both A and B) will use the highest version; 1.2.
This approach assumes that 1.2 is 100% backward compatible with 1.1, and this is a good and required approach. However, at certain times in the life cycle of libraries it is wise to empty the store. For me, any major changes to the API mean an increase in the main version, so 2.0 should not be 100% backward compatible with the latest 1.x. Good.
Maven, however, doesnβt care, and if pom B is upgraded from 1.2 to 2.0, Maven will use 2.0, but pom A cannot work with this version.
How to tell Maven that the version is no longer compatible with the previous version?
I tried to specify exclusion ranges, so A refers to [1.1.1.999] and B refers to [2.0.2.999]. However, Maven still solves the maximum version number (2.0).
source share