One place for maven project versions

We have a large tree of maven project projects and subprojects, and we want all pom to have the same version of the artifact.

So, in each pompe this version is placed twice - as the version of the artifact and the version of the parent artifact.

How can I put this version number only once (in the parent pump or in the properties file), instead of putting it twice in each pom?

thanks

+4
source share
2 answers

Remove the version number from the child projects and they inherit it from the parent.

+2
source

If your projects are real subprojects (sharing the same release / life cycle as the parent), you should integrate them as modules in your parents. See maven reference, 3.6.2. Multi-module and inheritance Thus, the maven-release plugin can process all versions of subprojects at once.

If your projects are not really subprojects, but simply dependent (with the release / life cycle itself), then there is no way to get around all the materials for the release / version for each project independently. At least I did not find one :(

0
source

Source: https://habr.com/ru/post/1342773/


All Articles