Skip to content

Commit

Permalink
1.18.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandr-m committed Feb 20, 2022
1 parent 122f178 commit 1c6a4cc
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 29 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
42 changes: 33 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The plugin is available from Maven Central.
<plugin>
<groupId>com.amashchenko.maven.plugin</groupId>
<artifactId>gitflow-maven-plugin</artifactId>
<version>1.17.0</version>
<version>1.18.0</version>
<configuration>
<!-- optional configuration -->
</configuration>
Expand All @@ -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.


Expand All @@ -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/).
Expand Down Expand Up @@ -182,13 +190,21 @@ Since `1.2.1` commit messages can be changed in plugin's configuration section i

<tagHotfixMessage>Tag hotfix</tagHotfixMessage>
<tagReleaseMessage>Tag release</tagReleaseMessage>
<tagVersionUpdateMessage>Tag version update</tagVersionUpdateMessage>

<!-- Migration Note: This was called <updateDevToAvoidConflitsMessage> in version 1.11.0, but has been deprecated in favour of the correctly spelt one below. -->
<updateDevToAvoidConflictsMessage>Update develop to production version to avoid merge conflicts</updateDevToAvoidConflictsMessage>
<updateDevBackPreMergeStateMessage>Update develop version back to pre-merge state</updateDevBackPreMergeStateMessage>
<updateReleaseToAvoidConflictsMessage>Update release to hotfix version to avoid merge conflicts</updateReleaseToAvoidConflictsMessage>
<updateReleaseBackPreMergeStateMessage>Update release version back to pre-merge state</updateReleaseBackPreMergeStateMessage>
<updateFeatureBackMessage>Update feature branch back to feature version</updateFeatureBackMessage>
<featureFinishIncrementVersionMessage>Increment feature version</featureFinishIncrementVersionMessage>
<supportStartMessage>Update versions for support branch</supportStartMessage>
<versionUpdateMessage>Update versions</versionUpdateMessage>
</commitMessages>
</configuration>

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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 `<gitFlowConfig><origin>custom_origin</origin></gitFlowConfig>` 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).
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<artifactId>gitflow-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
<name>gitflow-maven-plugin</name>
<version>1.17.1-SNAPSHOT</version>
<version>1.18.0</version>

<description>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.</description>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -203,6 +219,8 @@ public abstract class AbstractGitFlowMojo extends AbstractMojo {
* Multiple options can be added separated with a space e.g.
* <code>-DgitPushOptions="merge_request.create merge_request.target=develop
* merge_request.label='Super feature'"</code>
*
* @since 1.18.0
*/
@Parameter(property = "gitPushOptions")
private String gitPushOptions;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,13 @@ public class GitFlowHotfixFinishMojo extends AbstractGitFlowMojo {
private boolean skipMergeDevBranch = false;

/**
* Controls which branch is merged to develop branch. If set to
* <code>true</code> then hotfix branch will be merged to develop. If set to
* <code>false</code> and tag is present ({@link #skipTag} is set to
* Controls which branch is merged to development branch. If set to
* <code>true</code> then hotfix branch will be merged to development branch. If
* set to <code>false</code> and tag is present ({@link #skipTag} is set to
* <code>false</code>) 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,13 @@ public class GitFlowReleaseFinishMojo extends AbstractGitFlowMojo {
private boolean skipReleaseMergeProdBranch = false;

/**
* Controls which branch is merged to develop branch. If set to
* <code>true</code> then release branch will be merged to develop. If set to
* <code>false</code> and tag is present ({@link #skipTag} is set to
* Controls which branch is merged to development branch. If set to
* <code>true</code> then release branch will be merged to development branch.
* If set to <code>false</code> and tag is present ({@link #skipTag} is set to
* <code>false</code>) 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -47,34 +49,39 @@ 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;

/**
* The version to use in non-interactive mode.
*
* @since 1.18.0
*/
@Parameter(property = "updateVersion")
private String updateVersion;

/**
* Which digit to increment in the next version. Starts from zero.
*
* @since 1.18.0
*/
@Parameter(property = "updateVersionDigitToIncrement")
private Integer updateVersionDigitToIncrement;

/**
* Whether to skip tagging the release in Git.
*
* @since 1.18.0
*/
@Parameter(property = "skipTag", defaultValue = "false")
private boolean skipTag = false;

/**
* Whether to make a GPG-signed tag.
*
* @since 1.18.0
*/
@Parameter(property = "gpgSignTag", defaultValue = "false")
private boolean gpgSignTag = false;
Expand Down

0 comments on commit 1c6a4cc

Please sign in to comment.