简体   繁体   English

Jenkins + Maven中的自动增量版本号

[英]Autoincrement version number in Jenkins + Maven

I want to have autoincrementing version number in Maven during each build. 我想在每次构建期间在Maven中自动增加版本号。

I tried using autoincrement-versions-maven-plugin , it works fine. 我尝试使用autoincrement-versions-maven-plugin ,它运行正常。 But, the modified POM file need to be committed back to SVN from inside Jenkins. 但是,修改后的POM文件需要从Jenkins内部提交回SVN。

How do I do that? 我怎么做?

I have seen this thread: Incrementing Maven Project Version with Jenkins/Git 我见过这个帖子: 用Jenkins / Git增加Maven项目版本

You can use SVN Publisher 您可以使用SVN Publisher

If I understand your problem, you need to make commit on jenkins(commit changes on .pom file)? 如果我理解你的问题,你需要在jenkins上提交(在.pom文件上提交更改)?

Enjoy! 请享用!

You should be able to use the Maven scm plugin for this. 你应该能够使用Maven scm插件 Just setup an scm block in your pom, eg 只需在你的pom中设置一个scm块,例如

<project>
...
    <scm>
        <url>http://somerepository.com/view.cvs</url>
        <connection>scm:svn:http://somerepository.com/svn_repo/trunk</connection>
        <developerConnection>scm:svn:https://somerepository.com/svn_repo/trunk</developerConnection>
    </scm>
...
</project>

And then add a Jenkins Maven build step with goal 'scm:checkin' and parameters like commit message, repository username, and repository password. 然后使用目标'scm:checkin'和参数(如提交消息,存储库用户名和存储库密码)添加Jenkins Maven构建步骤。 More info here . 更多信息在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM