From 65a2dffc6c39c4d4e1892e05917a02a11d8bdbfc Mon Sep 17 00:00:00 2001 From: Aleksandr Mashchenko Date: Wed, 26 Oct 2016 00:27:53 +0300 Subject: [PATCH] add releaseVersion parameter to the release goal --- .../maven/plugin/gitflow/GitFlowReleaseMojo.java | 11 +++++++++++ .../maven/plugin/gitflow/GitFlowReleaseStartMojo.java | 8 +++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/amashchenko/maven/plugin/gitflow/GitFlowReleaseMojo.java b/src/main/java/com/amashchenko/maven/plugin/gitflow/GitFlowReleaseMojo.java index d1ace8db..b603c1b7 100644 --- a/src/main/java/com/amashchenko/maven/plugin/gitflow/GitFlowReleaseMojo.java +++ b/src/main/java/com/amashchenko/maven/plugin/gitflow/GitFlowReleaseMojo.java @@ -65,6 +65,15 @@ public class GitFlowReleaseMojo extends AbstractGitFlowMojo { @Parameter(property = "releaseMergeNoFF", defaultValue = "true") private boolean releaseMergeNoFF = true; + /** + * Release version to use instead of the default next release version in non + * interactive mode. + * + * @since 1.3.1 + */ + @Parameter(property = "releaseVersion", defaultValue = "") + private String releaseVersion = ""; + /** {@inheritDoc} */ @Override public void execute() throws MojoExecutionException, MojoFailureException { @@ -139,6 +148,8 @@ public void execute() throws MojoExecutionException, MojoFailureException { } catch (PrompterException e) { getLog().error(e); } + } else { + version = releaseVersion; } if (StringUtils.isBlank(version)) { diff --git a/src/main/java/com/amashchenko/maven/plugin/gitflow/GitFlowReleaseStartMojo.java b/src/main/java/com/amashchenko/maven/plugin/gitflow/GitFlowReleaseStartMojo.java index 67a59bf9..92d3e0e9 100644 --- a/src/main/java/com/amashchenko/maven/plugin/gitflow/GitFlowReleaseStartMojo.java +++ b/src/main/java/com/amashchenko/maven/plugin/gitflow/GitFlowReleaseStartMojo.java @@ -50,11 +50,9 @@ public class GitFlowReleaseStartMojo extends AbstractGitFlowMojo { private boolean sameBranchName = false; /** - * Release version. - *
- * - * Note: Work only in non interactive mode. - * + * Release version to use instead of the default next release version in non + * interactive mode. + * * @since 1.3.1 */ @Parameter(property = "releaseVersion", defaultValue = "")