Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Auto Closed
-
1.7
-
None
-
None
-
Mac OS X Snow Leopard
Maven 2 and 3
Maven SCM 1.7 and previous ones
Multi modules project
Description
I am unable to use the plugin buildnumber-maven-plugin to get the revision number with Git and SVN. After some investigations, I realized that the plugin used the Maven-SCM-API and their providers.
The command issued by the plugin is
/bin/sh -c cd /tmp/temp/mytestingrepo && git rev-parse --verify --short=7 HEAD
I run this command directly in a shell with the following error
fatal: Not a git repository (or any of the parent directories): .git
When I modify the command like the following one, it works perfectly
/bin/sh -c "cd /tmp/temp/mytestingrepo && git rev-parse --verify --short=7 HEAD"
It seems that the command is not executed correctly on my environment where the
/bin/sh -c "cd /tmp/temp/mytestingrepo
is executed and afterwards the command
git rev-parse --verify --short=7 HEAD
is done in the current directory. In the case of SVN 1.7 and Git, the .svn or .git are not located in subdirectories where the second command is executed.