Single place for maven projects versions
We have a large projects tree of maven projects and subprojects and we want ensure that all pom's have the same artifact version.
So in each pom this version is placed twice - as artifact version and parent artifact version.
How can I put this version number only once (in parent pom or in properties file) instead put开发者_运维知识库ting it twice to each pom?
Thank you
Remove the version number from the child projects and they will inherit it from the parent.
If your projects are real subprojects (share the same release/lifecycle as the parent) you should integrate them as modules in their parents. See the maven reference, 3.6.2. Multi-module vs. Inheritance This way the maven-release-plugin can handle all the versions of the subprojects at once.
If your projects are not really subprojects but mere dependencies (with a release/lifecycle on their own), then there's no way around doing all the release/versionmanagement stuff for each project on its own. At least I haven't found one :(
精彩评论