Maven Release prepare fails with Git submodules

Viewed 520

We have a multi-module Maven project, where the modules are also Git submodules.

When I perform mvn release:prepare on the parent project, I get this error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project big-project-parent: Unable to commit files
[ERROR] Provider message:
[ERROR] The git-add command failed.
[ERROR] Command output:
[ERROR] fatal: Pathspec 'basic-utils\pom.xml' is in submodule 'basic-utils'
1 Answers

Check first, as mentioned here, is the commitByProject can help (maven release 2.0+)

mvn release:prepare -DcommitByProject=true

MRELEASE-726 states that Git support has been improved with 2.5.x., so make sure to use a recent maven release plugin, 3.0+.

Related