本文介绍了如何在詹金斯自动化工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Maven Release Plugin来自动执行&发布过程.它工作正常,但我面临的一个问题.

I am using Maven Release Plugin for automate the build & release process.Its working fine but one problem I am facing.

我创建了一个作业,该作业每15分钟检查一次中继线,如果发现有任何更改,它将开始构建&发布过程.并且工作正常.

I have created a job, which is checking trunk in every 15 minutes, if any changes found it starts the build & release process.And its working fine.

但是,小问题是当release:prepare执行时,它正在创建标记并自动将trunk/pom.xml版本(带有SNAPSHOT)递增到下一发行版本SNAPSHOT.

But , small problem is when the release:prepare is executing , it is creating the tag and auto increment the trunk/pom.xml version (with SNAPSHOT) to next release version-SNAPSHOT.

假设我当前的构建版本是2.0-SNAPSHOT.成功构建后,仅使用2.0创建标签(不使用SNAPSHOT).还会自动将中继内的pom.xml递增到2.1-SNAPSHOT.

Suppose my current build version is 2.0-SNAPSHOT.After successfully build it create the tag with only 2.0 (without SNAPSHOT).Also it auto increments the pom.xml inside trunk to 2.1-SNAPSHOT.

问题是,当我的Jenkins(crontab)每15分钟检查一次中继时,会在中继内发现一个新版本(即pom.xml).并再次创建另一个版本.这个过程一次又一次地发生.在我知道主干没有代码更改的情况下,仅通过release:prepare命令增加了版本.

The problem is , when my Jenkins (crontab) checking the trunk in every 15 mins ,it is found a new version inside the trunk (i.e. pom.xml ). And it creates another build again. This process is happening again and again.Where I know there is no code changes in trunk, only version has incremented by release:prepare command.

在下面,我将提供詹金斯的屏幕截图以供参考.

Below I am giving the screen shot of Jenkins for reference.

任何帮助将不胜感激.

Any help would be appreciated.

谢谢.

推荐答案

通常在Maven中,快照构建是由源代码中的更改触发的,而发行版本则是按需创建的(发行代码时).这是Maven版本插件支持的工作流程.

Normally in Maven snapshot builds are triggered by changes in the source code and release builds are created on demand (when code is released). This is the workflow supported by the Maven release plugin.

尚不清楚您是否也拥有Jenkins M2版本插件是否安装?它提供了一个方便的发布"按钮来触发您工作上的发布版本.

It wasn't clear whether you also have the Jenkins M2 release plugin installed or not?It provides a convenient "Release" button to trigger release builds on your job.

这篇关于如何在詹金斯自动化工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-24 18:28