如何正确使用mvn release:prepare [英] how to use properly mvn release:prepare
问题描述
我在我的Maven项目中尝试使用此命令(使用dryrun进行测试):
I try this command (with dryrun to test) on my maven project :
mvn release:clean release:prepare -DdryRun=true -DgenerateBackupPoms=false -Dtag=solocal-refentreprive-2.1-RC02 -DreleaseVersion=2.1-RC02 -DdevelopmentVersion=2.1-SNAPSHOT
最后,构建成功,但是我(在提交过程中)有很多pom.next/pom.tag和pom.backUp....
at the end, the build is success, but i have (in my commit) many pom.next / pom.tag and pom.backUp....
那时候我不这样做(-DgenerateBackupPoms = false),如果我不使用dryrun就不想推这个pom ...
i don't when then (-DgenerateBackupPoms=false), if i use without dryrun i dont want push this pom...
Thx,
推荐答案
假设您接受默认版本:准备执行以下操作
Assuming you accept the defaults release:prepare performs the following
1)建立并检查所有测试通过
1) build and check all tests pass
2)检查是否没有快照依赖
2) check there are no SNAPSHOT dependencuies
3)将版本从x.x-SNAPSHOT更改为x.x
3) change the version from x.x-SNAPSHOT to x.x
4)推送到SCM中的标签
4) push to a tag in SCM
5)将下一次迭代的版本更改为x.(x + 1)-SNAPSHOT
5) change the version for the next iteration to x.(x+1)-SNAPSHOT
因此,pom.backUp是原始pom,pom.tag来自第3步,pom.next来自第5步.
So your pom.backUp is the original pom, your pom.tag is from step 3 and your pom.next is from step 5.
您可以使用mvn release:clean进行清理,它会在release:perform之后自动完成:请参见
You can clean up with a mvn release:clean which will be done automatically after a release:perform see maven-release
这篇关于如何正确使用mvn release:prepare的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!