From 1c6a4ccff1ab7e325535b0a93b6e7ab26352b38d Mon Sep 17 00:00:00 2001 From: Aleksandr Mashchenko Date: Sun, 20 Feb 2022 22:11:53 +0200 Subject: [PATCH] 1.18.0 release --- CHANGELOG.md | 17 ++++++++ README.md | 42 +++++++++++++++---- pom.xml | 2 +- .../plugin/gitflow/AbstractGitFlowMojo.java | 29 ++++++++----- .../gitflow/GitFlowHotfixFinishMojo.java | 9 ++-- .../gitflow/GitFlowReleaseFinishMojo.java | 9 ++-- .../gitflow/GitFlowVersionUpdateMojo.java | 7 ++++ 7 files changed, 86 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e6c5c8c..d1aaef90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## v1.18.0 (2022-02-20) + +### Breaking changes + +* Changed default branch to merge during release. Now tag or production branch will be merged to development branch. To restore previous behavior and merge release branch use `noBackMerge` parameter - [#213](https://github.com/aleksandr-m/gitflow-maven-plugin/issues/213) +* Changed default branch to merger during hotfix. Now tag or production branch will be merged to development branch. To restore previous behavior and merge hotfix branch use `noBackMergeHotfix` parameter - [#328](https://github.com/aleksandr-m/gitflow-maven-plugin/issues/328) +* Changed default versions of internal plugins `versions-maven-plugin` and `tycho-versions-plugin`. Now it is set in the code and can be modified with properties - [#330](https://github.com/aleksandr-m/gitflow-maven-plugin/issues/330) + +### --- + +* Added new `version-update` goal - [#269](https://github.com/aleksandr-m/gitflow-maven-plugin/issues/269) +* Improved getting current version of the project - [#324](https://github.com/aleksandr-m/gitflow-maven-plugin/pull/324) +* Added check for SNAPSHOT dependency in parent project definition - [#64](https://github.com/aleksandr-m/gitflow-maven-plugin/issues/64) +* Added ability to use [Maven version policy](https://maven.apache.org/maven-release/maven-release-api/apidocs/org/apache/maven/shared/release/policy/version/VersionPolicy.html) - [#235](https://github.com/aleksandr-m/gitflow-maven-plugin/pull/236) +* Added checkout from remote for development branch in `feature-start` goal - [#322](https://github.com/aleksandr-m/gitflow-maven-plugin/pull/322) +* Added ability to add [push-options](https://git-scm.com/docs/git-push#Documentation/git-push.txt--oltoptiongt) to git push - [#319](https://github.com/aleksandr-m/gitflow-maven-plugin/issues/319) + ## v1.17.0 (2021-12-07) * Fixed and improved error messages in `feature-start` goal - [#306](https://github.com/aleksandr-m/gitflow-maven-plugin/issues/306) diff --git a/README.md b/README.md index 47153fdc..001b0d02 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ The plugin is available from Maven Central. com.amashchenko.maven.plugin gitflow-maven-plugin - 1.17.0 + 1.18.0 @@ -42,6 +42,7 @@ The plugin is available from Maven Central. - `gitflow:hotfix-start` - Starts a hotfix branch and updates version(s) to hotfix version. - `gitflow:hotfix-finish` - Merges a hotfix branch. - `gitflow:support-start` - Starts a support branch from the production tag. +- `gitflow:version-update` - Updates version in release or support branch, optionally tagging and pushing it to the remote repository. - `gitflow:help` - Displays help information. @@ -61,10 +62,17 @@ To configure this plugin to use single branch model, such as GitHub Flow, just s That's it! + # Maven Wrapper support The plugin will automatically use Maven Wrapper for internal Maven goals if plugin is started with the wrapper. + +# Internal Maven plugins + +The `versions-maven-plugin` and `tycho-versions-plugin` are used internally to update versions and properties of the project. To change versions of internal plugins use `versionsMavenPluginVersion` and `tychoVersionsPluginVersion` properties respectively. + + # Eclipse Plugins build with Tycho Since version `1.1.0` this plugin supports Eclipse plugin projects which are build with [Tycho](https://eclipse.org/tycho/). @@ -182,6 +190,7 @@ Since `1.2.1` commit messages can be changed in plugin's configuration section i Tag hotfix Tag release + Tag version update Update develop to production version to avoid merge conflicts @@ -189,6 +198,13 @@ Since `1.2.1` commit messages can be changed in plugin's configuration section i Update release to hotfix version to avoid merge conflicts Update release version back to pre-merge state + + Update feature branch back to feature version + Increment feature version + + Update versions for support branch + + Update versions @@ -240,14 +256,6 @@ The default value is `false` (i.e. the project will be tested before merging bra All `release` goals have `allowSnapshots` parameter which controls whether SNAPSHOT dependencies are allowed. The default value is `false` (i.e. build fails if there SNAPSHOT dependency in project). -The `gitflow:release-finish` and `gitflow:release` goals have `digitsOnlyDevVersion` parameter which will remove qualifiers from the next development version if set to `true`. -For example, if the release version is `1.0.0-Final` then development version will be `1.0.1-SNAPSHOT`. -The default value is `false` (i.e. qualifiers will be preserved in next development version). - -The `gitflow:release-finish` and `gitflow:release` goals have `versionDigitToIncrement` parameter which controls which digit to increment in the next development version. Starts from zero. -For example, if the release version is `1.2.3.4` and `versionDigitToIncrement` is set to `1` then the next development version will be `1.3.0.0-SNAPSHOT`. -If not set or set to not valid value defaults to increment last digit in the version. - The `gitflow:release-start` and `gitflow:release-finish` have `commitDevelopmentVersionAtStart` parameter which controls whether the next development version is set and committed at start or after finish. By default the value is `false` which means that the next development version is set on the development branch after the release branch has been merged onto the development branch when finishing the release. This has the benefit of being able to easily cancel the release process simply by deleting the release branch. @@ -276,8 +284,22 @@ The `gitflow:hotfix-finish` goal supports the parameter `skipMergeDevBranch` whi The `gitflow:hotfix-finish` goal supports the parameter `skipMergeProdBranch` which prevents merging the hotfix branch into the production branch and deletes the hotfix branch leaving only the tagged commit. Useful, along with `skipMergeDevBranch`, to allow hotfixes to very old code that are not applicable to current development. +The `gitflow:release-finish` and `gitflow:hofix-finish` goals have `noBackMerge` and `noBackMergeHotfix` parameters respectively. They control which branch is merged to development branch. If set to `true` then release or hotfix branch will be merged to development branch. If set to `false` and tag is present (`skipTag` parameter is set to `false`) then tag will be merged. If there is no tag then production branch will be merged to development branch. + +### Versioning + +The `gitflow:release-finish` and `gitflow:release` goals have `digitsOnlyDevVersion` parameter which will remove qualifiers from the next development version if set to `true`. +For example, if the release version is `1.0.0-Final` then development version will be `1.0.1-SNAPSHOT`. +The default value is `false` (i.e. qualifiers will be preserved in next development version). + +The `gitflow:release-finish` and `gitflow:release` goals have `versionDigitToIncrement` parameter which controls which digit to increment in the next development version. Starts from zero. +For example, if the release version is `1.2.3.4` and `versionDigitToIncrement` is set to `1` then the next development version will be `1.3.0.0-SNAPSHOT`. +If not set or set to not valid value defaults to increment last digit in the version. + The `gitflow:hotfix-start` goal has `hotfixVersionDigitToIncrement` parameter which controls which digit to increment in the hotfix version. Starts from zero. +Versioninig can be controlled by using [Maven version policy](https://maven.apache.org/maven-release/maven-release-api/apidocs/org/apache/maven/shared/release/policy/version/VersionPolicy.html) implementation. Create appropriate implementation and add it as dependency to the project, use `projectVersionPolicyId` parameter to set policy id to use. If policy is set then other parameters controlling the generation of version are ignored (i.e. `digitsOnlyDevVersion`, `versionDigitToIncrement`). + Version update of all modules ignoring groupId and artifactId can be forced by setting `versionsForceUpdate` parameter to `true`. The default value is `false`. ### Remote interaction @@ -291,6 +313,8 @@ At the end of the `-start` goals newly created branch (release / feature / hotfi The default remote name is `origin`. It can be customized with `custom_origin` configuration in pom.xml. +Git [push-options](https://git-scm.com/docs/git-push#Documentation/git-push.txt--oltoptiongt) can be added to push command with the `gitPushOptions` parameter. Multiple options can be added separated with a space e.g. `-DgitPushOptions="merge_request.create merge_request.target=develop merge_request.label='Super feature'"`. + ### Rebase, Merge, Fast Forward, Squash Release branch can be rebased instead of merged by setting `releaseRebase` parameter to `true`. The default value is `false` (i.e. merge will be performed). diff --git a/pom.xml b/pom.xml index efbb49f3..6d760823 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ gitflow-maven-plugin maven-plugin gitflow-maven-plugin - 1.17.1-SNAPSHOT + 1.18.0 The Git-Flow Maven Plugin supports various Git workflows, including Vincent Driessen's successful Git branching model and GitHub Flow. This plugin runs Git and Maven commands from the command line. Supports Eclipse Plugins build with Tycho. diff --git a/src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java b/src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java index 5dcb3abe..d5e81f36 100644 --- a/src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java +++ b/src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java @@ -186,14 +186,30 @@ public abstract class AbstractGitFlowMojo extends AbstractMojo { @Parameter(property = "updateOutputTimestamp", defaultValue = "true") private boolean updateOutputTimestamp = true; + /** + * The role-hint for the + * {@link org.apache.maven.shared.release.policy.version.VersionPolicy} + * implementation used to calculate the project versions. If a policy is set + * other parameters controlling the generation of version are ignored + * (digitsOnlyDevVersion, versionDigitToIncrement). + * + * @since 1.18.0 + */ + @Parameter(property = "projectVersionPolicyId") + private String projectVersionPolicyId; + /** * Version of versions-maven-plugin to use. + * + * @since 1.18.0 */ @Parameter(property = "versionsMavenPluginVersion", defaultValue = "2.8.1") private String versionsMavenPluginVersion = "2.8.1"; /** * Version of tycho-versions-plugin to use. + * + * @since 1.18.0 */ @Parameter(property = "tychoVersionsPluginVersion", defaultValue = "0.24.0") private String tychoVersionsPluginVersion = "0.24.0"; @@ -203,6 +219,8 @@ public abstract class AbstractGitFlowMojo extends AbstractMojo { * Multiple options can be added separated with a space e.g. * -DgitPushOptions="merge_request.create merge_request.target=develop * merge_request.label='Super feature'" + * + * @since 1.18.0 */ @Parameter(property = "gitPushOptions") private String gitPushOptions; @@ -218,17 +236,6 @@ public abstract class AbstractGitFlowMojo extends AbstractMojo { @Parameter(property = "gitExecutable") private String gitExecutable; - /** - * The role-hint for the {@link org.apache.maven.shared.release.policy.version.VersionPolicy} - * implementation used to calculate the project versions. - * If a policy is set other parameters controlling the generation of version are ignored - * (digitsOnlyDevVersion, versionDigitToIncrement). - * - * @since 1.18.0 - */ - @Parameter(property = "projectVersionPolicyId") - private String projectVersionPolicyId; - /** Maven session. */ @Parameter(defaultValue = "${session}", readonly = true) protected MavenSession mavenSession; diff --git a/src/main/java/com/amashchenko/maven/plugin/gitflow/GitFlowHotfixFinishMojo.java b/src/main/java/com/amashchenko/maven/plugin/gitflow/GitFlowHotfixFinishMojo.java index e738debe..350140bd 100644 --- a/src/main/java/com/amashchenko/maven/plugin/gitflow/GitFlowHotfixFinishMojo.java +++ b/src/main/java/com/amashchenko/maven/plugin/gitflow/GitFlowHotfixFinishMojo.java @@ -129,12 +129,13 @@ public class GitFlowHotfixFinishMojo extends AbstractGitFlowMojo { private boolean skipMergeDevBranch = false; /** - * Controls which branch is merged to develop branch. If set to - * true then hotfix branch will be merged to develop. If set to - * false and tag is present ({@link #skipTag} is set to + * Controls which branch is merged to development branch. If set to + * true then hotfix branch will be merged to development branch. If + * set to false and tag is present ({@link #skipTag} is set to * false) then tag will be merged. If there is no tag then - * production branch will be merged to develop. + * production branch will be merged to development branch. * + * @since 1.18.0 */ @Parameter(property = "noBackMergeHotfix", defaultValue = "false") private boolean noBackMergeHotfix = false; diff --git a/src/main/java/com/amashchenko/maven/plugin/gitflow/GitFlowReleaseFinishMojo.java b/src/main/java/com/amashchenko/maven/plugin/gitflow/GitFlowReleaseFinishMojo.java index 6544bd3c..c25425c0 100644 --- a/src/main/java/com/amashchenko/maven/plugin/gitflow/GitFlowReleaseFinishMojo.java +++ b/src/main/java/com/amashchenko/maven/plugin/gitflow/GitFlowReleaseFinishMojo.java @@ -168,12 +168,13 @@ public class GitFlowReleaseFinishMojo extends AbstractGitFlowMojo { private boolean skipReleaseMergeProdBranch = false; /** - * Controls which branch is merged to develop branch. If set to - * true then release branch will be merged to develop. If set to - * false and tag is present ({@link #skipTag} is set to + * Controls which branch is merged to development branch. If set to + * true then release branch will be merged to development branch. + * If set to false and tag is present ({@link #skipTag} is set to * false) then tag will be merged. If there is no tag then - * production branch will be merged to develop. + * production branch will be merged to development branch. * + * @since 1.18.0 */ @Parameter(property = "noBackMerge", defaultValue = "false") private boolean noBackMerge = false; diff --git a/src/main/java/com/amashchenko/maven/plugin/gitflow/GitFlowVersionUpdateMojo.java b/src/main/java/com/amashchenko/maven/plugin/gitflow/GitFlowVersionUpdateMojo.java index 0aee3410..e014e57a 100644 --- a/src/main/java/com/amashchenko/maven/plugin/gitflow/GitFlowVersionUpdateMojo.java +++ b/src/main/java/com/amashchenko/maven/plugin/gitflow/GitFlowVersionUpdateMojo.java @@ -33,12 +33,14 @@ * Updates version in release or support branch, optionally tagging and pushing * it to the remote repository. * + * @since 1.18.0 */ @Mojo(name = "version-update", aggregator = true) public class GitFlowVersionUpdateMojo extends AbstractGitFlowMojo { /** * Whether to push to the remote. * + * @since 1.18.0 */ @Parameter(property = "pushRemote", defaultValue = "false") private boolean pushRemote; @@ -47,6 +49,7 @@ public class GitFlowVersionUpdateMojo extends AbstractGitFlowMojo { * Branch to start update in non-interactive mode. Release branch or one of the * support branches. * + * @since 1.18.0 */ @Parameter(property = "fromBranch") private String fromBranch; @@ -54,6 +57,7 @@ public class GitFlowVersionUpdateMojo extends AbstractGitFlowMojo { /** * The version to use in non-interactive mode. * + * @since 1.18.0 */ @Parameter(property = "updateVersion") private String updateVersion; @@ -61,6 +65,7 @@ public class GitFlowVersionUpdateMojo extends AbstractGitFlowMojo { /** * Which digit to increment in the next version. Starts from zero. * + * @since 1.18.0 */ @Parameter(property = "updateVersionDigitToIncrement") private Integer updateVersionDigitToIncrement; @@ -68,6 +73,7 @@ public class GitFlowVersionUpdateMojo extends AbstractGitFlowMojo { /** * Whether to skip tagging the release in Git. * + * @since 1.18.0 */ @Parameter(property = "skipTag", defaultValue = "false") private boolean skipTag = false; @@ -75,6 +81,7 @@ public class GitFlowVersionUpdateMojo extends AbstractGitFlowMojo { /** * Whether to make a GPG-signed tag. * + * @since 1.18.0 */ @Parameter(property = "gpgSignTag", defaultValue = "false") private boolean gpgSignTag = false;