Maven SCM
  1. Maven SCM
  2. SCM-656

Building maven-scm-1.6 requires a native install of git.

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.7
    • Component/s: maven-scm-provider-git
    • Labels:
      None
    • Environment:
      Windows XP
      maven 2.2.1
    • Complexity:
      Intermediate
    • Number of attachments :
      2

      Description

      Check out a fresh copy of maven-scm-1.6 and attempt to build via "mvn clean install" and it fails due to a missing native git.exe not being present.

      Running org.apache.maven.scm.provider.git.gitexe.command.checkout.GitExeCheckOutCommandNoBranchTest
      [INFO] Executing: cmd.exe /X /C "git clone C\Workspaces\\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\src\test\resources\repository_no_branch C:\Workspaces\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target\checkin-nobranch"
      [INFO] Working directory: C:\Workspaces\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target
      ----------------------------------------------------------------------
      Provider message
      ----------------------------------------------------------------------
      The git-clone command failed.
      ----------------------------------------------------------------------
      ----------------------------------------------------------------------
      Command output
      ----------------------------------------------------------------------
      'git' is not recognized as an internal or external command,
      operable program or batch file.

      ----------------------------------------------------------------------
      [INFO] Executing: cmd.exe /X /C "git clone C\Workspaces\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\src\test\resources\repository_no_branch C:\Workspaces\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target\checkin-nobranch"
      [INFO] Working directory: C:\Workspaces\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target
      ----------------------------------------------------------------------
      Provider message
      ----------------------------------------------------------------------
      The git-clone command failed.
      ----------------------------------------------------------------------
      ----------------------------------------------------------------------
      Command output
      ----------------------------------------------------------------------
      'git' is not recognized as an internal or external command,
      operable program or batch file.

      1. git-no-exe.patch
        5 kB
        Chris Graham
      2. git-test-fail.patch
        2 kB
        Chris Graham

        Activity

        Hide
        Chris Graham added a comment -

        As a follow up.

        Even when git is installed, there are still issues with the build.

        So there would appear to be some additional setup required:

        Running org.apache.maven.scm.provider.git.gitexe.command.checkin.GitCheckInCommandNoBranchTest
        [INFO] Executing: cmd.exe /X /C "git clone C\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target\git_copy C:\CALM
        Data\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target\checkin-nobranch"
        [INFO] Working directory: C:\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target
        ----------------------------------------------------------------------
        Provider message
        ----------------------------------------------------------------------
        The git-clone command failed.
        ----------------------------------------------------------------------
        ----------------------------------------------------------------------
        Command output
        ----------------------------------------------------------------------
        fatal: repository 'C\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target\git_copy' does not exist

        ----------------------------------------------------------------------
        Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.985 sec <<< FAILURE!
        Running org.apache.maven.scm.provider.git.gitexe.command.checkin.GitCheckInCommandTest
        Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 sec
        Running org.apache.maven.scm.provider.git.gitexe.command.checkout.GitCheckOutCommandTest
        Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.032 sec
        Running org.apache.maven.scm.provider.git.gitexe.command.checkout.GitExeCheckOutCommandNoBranchTest
        [INFO] Executing: cmd.exe /X /C "git clone C\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\src\test\resources\repo
        sitory_no_branch C:\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target\checkin-nobranch"
        [INFO] Working directory: C:\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target
        ----------------------------------------------------------------------
        Provider message
        ----------------------------------------------------------------------
        The git-clone command failed.
        ----------------------------------------------------------------------
        ----------------------------------------------------------------------
        Command output
        ----------------------------------------------------------------------
        fatal: repository 'C\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\src\test\resources\repository_no_branch' does n
        ot exist

        ----------------------------------------------------------------------
        [INFO] Executing: cmd.exe /X /C "git clone C\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\src\test\resources\repo
        sitory_no_branch C:\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target\checkin-nobranch"
        [INFO] Working directory: C:\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target
        ----------------------------------------------------------------------
        Provider message
        ----------------------------------------------------------------------
        The git-clone command failed.
        ----------------------------------------------------------------------
        ----------------------------------------------------------------------
        Command output
        ----------------------------------------------------------------------
        fatal: repository 'C\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\src\test\resources\repository_no_branch' does n
        ot exist

        ----------------------------------------------------------------------
        Tests run: 2, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 0.609 sec <<< FAILURE!
        Running org.apache.maven.scm.provider.git.gitexe.command.remoteinfo.GitRemoteInfoConsumerTest
        Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec
        Running org.apache.maven.scm.provider.git.gitexe.command.remove.GitRemoveCommandTest
        Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.687 sec
        Running org.apache.maven.scm.provider.git.gitexe.command.remove.GitRemoveConsumerTest
        Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.047 sec
        Running org.apache.maven.scm.provider.git.gitexe.command.status.GitStatusConsumerTest
        Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.203 sec
        Running org.apache.maven.scm.provider.git.gitexe.command.tag.GitTagCommandTest
        Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.016 sec
        Running org.apache.maven.scm.provider.git.gitexe.command.update.GitLatestRevisionCommandConsumerTest
        Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 sec
        Running org.apache.maven.scm.provider.git.gitexe.command.update.GitUpdateCommandConsumerTest
        Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.031 sec
        Running org.apache.maven.scm.provider.git.gitexe.command.update.GitUpdateCommandTest
        Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.031 sec

        Results :

        Failed tests: testCheckinNoBranch(org.apache.maven.scm.provider.git.gitexe.command.checkin.GitCheckInCommandNoBranchTest): The check out result success flag was false.
        testCheckoutNoBranch(org.apache.maven.scm.provider.git.gitexe.command.checkout.GitExeCheckOutCommandNoBranchTest): The check out result success flag was false.
        testDoubleCheckoutNoBranch(org.apache.maven.scm.provider.git.gitexe.command.checkout.GitExeCheckOutCommandNoBranchTest): The check out result success flag was false.

        Tests run: 57, Failures: 3, Errors: 0, Skipped: 0

        [INFO] ------------------------------------------------------------------------
        [ERROR] BUILD FAILURE
        [INFO] ------------------------------------------------------------------------
        [INFO] There are test failures.

        Please refer to C:\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target\surefire-reports for the individual test results.
        [INFO] ------------------------------------------------------------------------
        [INFO] For more information, run Maven with the -e switch
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: 4 minutes 20 seconds
        [INFO] Finished at: Thu Jan 12 11:22:42 EST 2012
        [INFO] Final Memory: 195M/302M
        [INFO] ------------------------------------------------------------------------
        C:\CALMData\Workspaces\RTC\Deb\maven-scm-1.6>

        Is this a GIT issue?

        fatal: repository 'C\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\src\test\resources\repository_no_branch' does not exist

        It should be 'C:\CALMData\...' What happened to the colon?

        Clearly this can not be fixed for 1.6. However, the same issues are still occurring for 1.7-SNAPSHOT, so can it be fixed there?

        Show
        Chris Graham added a comment - As a follow up. Even when git is installed, there are still issues with the build. So there would appear to be some additional setup required: Running org.apache.maven.scm.provider.git.gitexe.command.checkin.GitCheckInCommandNoBranchTest [INFO] Executing: cmd.exe /X /C "git clone C\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target\git_copy C:\CALM Data\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target\checkin-nobranch" [INFO] Working directory: C:\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target ---------------------------------------------------------------------- Provider message ---------------------------------------------------------------------- The git-clone command failed. ---------------------------------------------------------------------- ---------------------------------------------------------------------- Command output ---------------------------------------------------------------------- fatal: repository 'C\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target\git_copy' does not exist ---------------------------------------------------------------------- Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.985 sec <<< FAILURE! Running org.apache.maven.scm.provider.git.gitexe.command.checkin.GitCheckInCommandTest Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 sec Running org.apache.maven.scm.provider.git.gitexe.command.checkout.GitCheckOutCommandTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.032 sec Running org.apache.maven.scm.provider.git.gitexe.command.checkout.GitExeCheckOutCommandNoBranchTest [INFO] Executing: cmd.exe /X /C "git clone C\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\src\test\resources\repo sitory_no_branch C:\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target\checkin-nobranch" [INFO] Working directory: C:\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target ---------------------------------------------------------------------- Provider message ---------------------------------------------------------------------- The git-clone command failed. ---------------------------------------------------------------------- ---------------------------------------------------------------------- Command output ---------------------------------------------------------------------- fatal: repository 'C\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\src\test\resources\repository_no_branch' does n ot exist ---------------------------------------------------------------------- [INFO] Executing: cmd.exe /X /C "git clone C\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\src\test\resources\repo sitory_no_branch C:\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target\checkin-nobranch" [INFO] Working directory: C:\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target ---------------------------------------------------------------------- Provider message ---------------------------------------------------------------------- The git-clone command failed. ---------------------------------------------------------------------- ---------------------------------------------------------------------- Command output ---------------------------------------------------------------------- fatal: repository 'C\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\src\test\resources\repository_no_branch' does n ot exist ---------------------------------------------------------------------- Tests run: 2, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 0.609 sec <<< FAILURE! Running org.apache.maven.scm.provider.git.gitexe.command.remoteinfo.GitRemoteInfoConsumerTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec Running org.apache.maven.scm.provider.git.gitexe.command.remove.GitRemoveCommandTest Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.687 sec Running org.apache.maven.scm.provider.git.gitexe.command.remove.GitRemoveConsumerTest Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.047 sec Running org.apache.maven.scm.provider.git.gitexe.command.status.GitStatusConsumerTest Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.203 sec Running org.apache.maven.scm.provider.git.gitexe.command.tag.GitTagCommandTest Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.016 sec Running org.apache.maven.scm.provider.git.gitexe.command.update.GitLatestRevisionCommandConsumerTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 sec Running org.apache.maven.scm.provider.git.gitexe.command.update.GitUpdateCommandConsumerTest Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.031 sec Running org.apache.maven.scm.provider.git.gitexe.command.update.GitUpdateCommandTest Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.031 sec Results : Failed tests: testCheckinNoBranch(org.apache.maven.scm.provider.git.gitexe.command.checkin.GitCheckInCommandNoBranchTest): The check out result success flag was false. testCheckoutNoBranch(org.apache.maven.scm.provider.git.gitexe.command.checkout.GitExeCheckOutCommandNoBranchTest): The check out result success flag was false. testDoubleCheckoutNoBranch(org.apache.maven.scm.provider.git.gitexe.command.checkout.GitExeCheckOutCommandNoBranchTest): The check out result success flag was false. Tests run: 57, Failures: 3, Errors: 0, Skipped: 0 [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] There are test failures. Please refer to C:\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target\surefire-reports for the individual test results. [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4 minutes 20 seconds [INFO] Finished at: Thu Jan 12 11:22:42 EST 2012 [INFO] Final Memory: 195M/302M [INFO] ------------------------------------------------------------------------ C:\CALMData\Workspaces\RTC\Deb\maven-scm-1.6> Is this a GIT issue? fatal: repository 'C\CALMData\Workspaces\RTC\Deb\maven-scm-1.6\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\src\test\resources\repository_no_branch' does not exist It should be 'C:\CALMData\...' What happened to the colon? Clearly this can not be fixed for 1.6. However, the same issues are still occurring for 1.7-SNAPSHOT, so can it be fixed there?
        Hide
        Olivier Lamy added a comment -

        looks to be an issue on windauze .
        As it works here (osx) and on ASF Jenkins (https://builds.apache.org/job/maven-scm/) ubuntu machine.
        Perso I don't have windauze .
        Do you have idea or patch to provide ?

        Show
        Olivier Lamy added a comment - looks to be an issue on windauze . As it works here (osx) and on ASF Jenkins ( https://builds.apache.org/job/maven-scm/ ) ubuntu machine. Perso I don't have windauze . Do you have idea or patch to provide ?
        Hide
        Robert Scholte added a comment -

        I can confirm this issue. The problem seems to be the GitScmProviderRepository which tries to evaluate the URL and seems to have trouble with the drive-name.

        Show
        Robert Scholte added a comment - I can confirm this issue. The problem seems to be the GitScmProviderRepository which tries to evaluate the URL and seems to have trouble with the drive-name.
        Hide
        Chris Graham added a comment -

        This changes the local file system repos to use file:/// + repo.getAbsolutePath().

        Show
        Chris Graham added a comment - This changes the local file system repos to use file:/// + repo.getAbsolutePath().
        Hide
        Olivier Lamy added a comment -

        should be fixed with rev 1240094
        can a windauze user confirms ?

        Show
        Olivier Lamy added a comment - should be fixed with rev 1240094 can a windauze user confirms ?
        Hide
        Olivier Lamy added a comment -

        btw I have added a jenkins job on windauze node: https://builds.apache.org/job/maven-scm-windows

        Show
        Olivier Lamy added a comment - btw I have added a jenkins job on windauze node: https://builds.apache.org/job/maven-scm-windows
        Hide
        Olivier Lamy added a comment -

        should be fixed with r1240126
        if not reopen the issue.

        Show
        Olivier Lamy added a comment - should be fixed with r1240126 if not reopen the issue.
        Hide
        Chris Graham added a comment -

        The patch fixed the issue of the tests failing on windows. Yey!

        However, the original issue, of still requiring a native install of git, that has still yet to be resolved.

        I would like to be able to build all of the scm tree without any native scm tools in place.

        Show
        Chris Graham added a comment - The patch fixed the issue of the tests failing on windows. Yey! However, the original issue, of still requiring a native install of git, that has still yet to be resolved. I would like to be able to build all of the scm tree without any native scm tools in place.
        Hide
        Olivier Lamy added a comment -
        Show
        Olivier Lamy added a comment - nope I have normally fix that too see http://svn.apache.org/viewvc?view=revision&revision=1240126
        Hide
        Chris Graham added a comment -

        Indeed so you had. Here is a slightly more elegant means of doing the same thing, and it is more consistent with the way that the other providers are tested (which is my preference).

        Show
        Chris Graham added a comment - Indeed so you had. Here is a slightly more elegant means of doing the same thing, and it is more consistent with the way that the other providers are tested (which is my preference).
        Hide
        Chris Graham added a comment -

        Actually, getting back to the issue with the broken URL's, there is a better way, one that was already there:

        So, change:

        scmRepository = getScmManager().makeScmRepository( "scm:git:file:///" + repo.getAbsolutePath() );

        To:

        scmRepository = getScmManager().makeScmRepository( GitScmTestUtils.getScmUrl(repo, "git") );

        And you've got effectively the same thing. And, it now covers the cygwin stuff as well (so I'm assuming that it's better tested).

        Show
        Chris Graham added a comment - Actually, getting back to the issue with the broken URL's, there is a better way, one that was already there: So, change: scmRepository = getScmManager().makeScmRepository( "scm:git: file:/// " + repo.getAbsolutePath() ); To: scmRepository = getScmManager().makeScmRepository( GitScmTestUtils.getScmUrl(repo, "git") ); And you've got effectively the same thing. And, it now covers the cygwin stuff as well (so I'm assuming that it's better tested).
        Hide
        Chris Graham added a comment - - edited

        Opps. I'm not sure if this will work:

        if ( !isSystemCmd( GitScmTestUtils.GIT_COMMAND_LINE ) )

        { System.err.println( "'" + GitScmTestUtils.GIT_COMMAND_LINE + "' is not a system command. Ignored " + getName() + "." ); return; }

        because on my system, I have git.cmd in the path, not git.exe.

        So it incorrectly thinks that git is not available. (When it is).

        When I've added the git bin dir into the path (where git.exe lives), the test successfully runs - it does not erroneously skip the test.

        Show
        Chris Graham added a comment - - edited Opps. I'm not sure if this will work: if ( !isSystemCmd( GitScmTestUtils.GIT_COMMAND_LINE ) ) { System.err.println( "'" + GitScmTestUtils.GIT_COMMAND_LINE + "' is not a system command. Ignored " + getName() + "." ); return; } because on my system, I have git.cmd in the path, not git.exe. So it incorrectly thinks that git is not available. (When it is). When I've added the git bin dir into the path (where git.exe lives), the test successfully runs - it does not erroneously skip the test.
        Hide
        Olivier Lamy added a comment -

        Should be fixed I simply missed to close the issue.

        Show
        Olivier Lamy added a comment - Should be fixed I simply missed to close the issue.

          People

          • Assignee:
            Olivier Lamy
            Reporter:
            Chris Graham
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: