I have a par开发者_开发百科ent pom with list of modules. Each module has a <parent> section with version number of a parent. First I do a release, which creates tag with version without SNAPSHOT and then I want to create a branch from that tag. The problem is that maven keeps asking about version number for each module. Is there a way to make maven set all modules to the same version? Thanks.
If you're using the release plugin, and by 'do a release' you mean run
mvn release:prepare release:perform
then you can add the autoVersionSubmodules flag, as follows:
mvn release:prepare release:perform -DautoVersionSubmodules=true
This will set the version of all your child projects to the version you accept for the parent. Or if you just want to accept all the defaults, you can use the --batch-mode option. See http://maven.apache.org/plugins/maven-release-plugin/examples/non-interactive-release.html for details.
You can use release:branch goal instead of release:prepare
精彩评论