On Fri, Oct 27, 2017 at 1:58 AM ahardy42 <adam.ha...@cyberspaceroad.com>
wrote:

> How can I tell maven to increment the version and commit the edited pom
> without the CI platform seeing the commit and kicking off again in an
> infinite loop?


Indeed.  If you just use the maven-release-plugin, as you should, on
something like Gitlab CI, for example, then indeed you'll get an infinite
loop.  I've been burned by this several times.

Some of these CI systems have a way to specify skipping CI on a given
checkin.  For example, in Gitlab, you can use "[skip ci]" in your commit
message, and any configured pipelines won't run:
https://docs.gitlab.com/ee/ci/yaml/#skipping-jobs  This is true of Travis
CI as well:
https://docs.travis-ci.com/user/customizing-the-build/#Skipping-a-build

So if you set the <scmCommentPrefix> property either on the command line or
in your pom.xml to contain "[skip ci]" (in Gitlab's or Travis CI's case),
you will be good (
http://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html#scmCommentPrefix).
The commits that the maven-release-plugin will have this string in their
commit message, and that will break the infinite loop.

Best,
Laird
--
https://about.me/lairdnelson

Reply via email to