Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add updateSubmodulesBeforeCommit option (fixes #348) #347

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ The `gitflow:release`, `gitflow:release-finish` and `gitflow:hotfix-finish` goal

All goals have `gpgSignCommit` parameter. Set it to `true` to sign commits with configured personal key. The default value is `false`.

### Updating submodules before commit

All goals have `updateSubmodulesBeforeCommit` parameter. Set it to `true` to run `git submodule update` before the plugin commits any changes. The default value is `true`.

# Support for Reproducible Builds

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.18.1-SNAPSHOT</version>
<version>1.19.0-SNAPSHOT</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 @@ -143,6 +143,14 @@ public abstract class AbstractGitFlowMojo extends AbstractMojo {
@Parameter(property = "gpgSignCommit", defaultValue = "false")
private boolean gpgSignCommit = false;

/**
* Whether to update submodules before commit.
*
* @since 1.19.0
*/
@Parameter(property = "updateSubmodulesBeforeCommit", defaultValue = "true")
private boolean updateSubmodulesBeforeCommit = true;

/**
* Whether to set -DgroupId='*' -DartifactId='*' when calling
* versions-maven-plugin.
Expand Down Expand Up @@ -796,6 +804,11 @@ protected void gitCommit(String message, Map<String, String> messageProperties)

message = replaceProperties(message, messageProperties);

if (updateSubmodulesBeforeCommit) {
getLog().info("Updating submodules before commit.");
executeGitCommand("submodule", "update");
}

if (gpgSignCommit) {
getLog().info("Committing changes. GPG-signed.");

Expand Down