Actually, you can use the x-SNAPSHOT version and use the maven-release-plugin . Just use mvn release:prepare to mvn release:perform to prepare the release and change the version in poms from x-SNAPSHOT to the new version (you will be asked to use versions). You can check this introduction in the maven-release plugin for a quick overview of release:prepare and release:perform .
Then, to enable the latest version without constantly updating the dependency version, you can use the dependency ranges, as in the following fragment, where we specify the range: Junit 3.8 - Junit 4.0:
<dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>[3.8,4.0)</version> <scope>test</scope> </dependency>
A version before or after the decimal point is not required, and means +/- infinity. For example, [4.0,) means any version greater than or equal to 4.0.
Personally, I do not like to use dependency ranges because I find that this can lead to reproducibility problems and makes the assembly more fragile.
But you may have good reasons for using them.
Pascal thivent
source share