简体   繁体   English

Jenkins作业使用Maven-release-plugin自动转换吗?

[英]Jenkins job auto-versioning with maven-release-plugin?

is it possible to do the following. 是否可以执行以下操作?

I set up on jenkins maven-release-plugin. 我设置了jenkins maven-release-plugin。 https://wiki.jenkins-ci.org/display/JENKINS/M2+Release+Plugin He works. https://wiki.jenkins-ci.org/display/JENKINS/M2+Release+Plugin他工作。 But I need to press Release and change the version manually. 但是我需要按Release键并手动更改版本。

How to do to make everything automatically after every commit? 每次提交后如何自动制作所有内容? We've committed and jenkins automatically generate a new version. 我们已经承诺,詹金斯会自动生成一个新版本。

Thanks. 谢谢。

If you use the maven-release-plugin approach, there is not much alternative to pressing the button and entering the release number. 如果您使用maven-release-plugin方法,则除了按下按钮并输入发行号之外,没有太多选择。

What's simpler and works better for many purposes is to avoid that. 避免这种情况的更简单且更有效的解决方案是。 Instead: 代替:

  • manage the first two or three digits of the version number manually by simply editing the pom and committing/pushing changes. 只需编辑pom并提交/推动更改,即可手动管理版本号的前两位或三位数。
  • have the last digit come from a build number supplied by jenkins. 最后一位数字来自詹金斯提供的内部版本号。

Tutorials on slightly different approaches to do this here and here . 这里这里 ,有关执行此操作的方法略有不同的教程。

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

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