7

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'
Ionut Bilica
  • 424
  • 1
  • 5
  • 11

1 Answers1

0

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+.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I had the same problem. Setting the parameter commitByProject gets rid of the first error, but gives me a new one: "Updates were rejected because the remote contains work that you do not have locally". But fetching from the remote shows me the opposite. I have local changes, caused by Maven having made a commit in one of the submodules. Still searching for a solution. – Clon Feb 14 '22 at 20:03
  • @Clon Interesting. You might need to write a separate question for this (adding more details about OS, Git and maven version) – VonC Feb 14 '22 at 22:02