Versions for the maven project with small, very frequent releases

I am converting an ant project to maven. This project is different from the ones I usually converted, as it has very frequent releases, usually 8-10 times a day.

By the issue, I mean that the received can is packaged and included in the production environment. This project is a leaf project, so it does not publish the API, it only absorbs it. It is also nothing more than a runtime dependency for two other projects.

I would like to have a version control scheme where:

  • easy to deploy without forcing developers to think about which version number to assign to the project, since the number does not make sense;
  • It is easy to include the latest version of this project as a dependency, without constantly selecting the version of the dependency;

Most likely, the dependency version will not be -SNAPSHOT , as this would contradict the maven-release-plugin , which we use for other projects, but I am open to suggestions.

+6
maven-2 versioning release-management
source share
1 answer

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.

+5
source share

All Articles