When I execute a build using a Maven 3 project, the initial checkout/out works fine (referencing "hg" using its full path) but subsequently the build fails as follows:

      [INFO] --- maven-release-plugin:2.1:perform (default-cli) @ cmake ---
      [INFO] Checking out the project to perform the release ...
      [INFO] Removing /Users/builds/.jenkins/workspace/cmake/target/checkout
      [INFO] EXECUTING: /bin/sh -c cd /Users/builds/.jenkins/workspace/cmake/target && hg clone -r release-2.8.10-b1 https://cmake-maven-project.googlecode.com/hg/ /Users/builds/.jenkins/workspace/cmake/target/checkout
      [ERROR] 
      EXECUTION FAILED
        Execution of cmd : clone failed with exit code: 127.
        Working directory was: 
          /Users/builds/.jenkins/workspace/cmake/target
        Your Hg installation seems to be valid and complete.
          Hg version: NA (OK)
      

      In other words, it looks like Jenkins is smart enough to reference hg using its full path, but the hg scm vendor (used by "release:perform" goal) assumes "hg" is on the PATH.

      I couldn't find a workaround. I found one other discussion thread but no solution: http://maven.40175.n5.nabble.com/How-to-specify-full-path-of-a-executable-for-a-scm-vendor-td5463712.html

      To reproduce the problem, create a Maven3 project with the following build task:

      "clean:clean release:clean release:perform -Pmac -Dtag=release-2.8.10-b1 -DconnectionUrl=scm:hg:https://cmake-maven-project.googlecode.com/hg/"

          [JENKINS-16151] Maven "release:perform" cannot find hg

          cowwoc added a comment -

          Also, you should be able to reproduce this problem under Linux. I don't think it's OSX specific.

          cowwoc added a comment - Also, you should be able to reproduce this problem under Linux. I don't think it's OSX specific.

          Jesse Glick added a comment -

          Not sure if this is something the Mercurial plugin can do much about; it would have to adjust the $PATH used by Maven, I guess.

          Jesse Glick added a comment - Not sure if this is something the Mercurial plugin can do much about; it would have to adjust the $PATH used by Maven, I guess.

          cowwoc added a comment -

          I posted this question to the Maven mailing list and it doesn't look like this is supported at this time: http://maven.40175.n5.nabble.com/How-to-specify-full-path-of-a-executable-for-a-scm-vendor-tp5463712p5739204.html

          Currently I am using the EnvInject plugin to add hg to the PATH but obviously this sort of thing should be handled automatically by Jenkins. Let me know what you think.

          cowwoc added a comment - I posted this question to the Maven mailing list and it doesn't look like this is supported at this time: http://maven.40175.n5.nabble.com/How-to-specify-full-path-of-a-executable-for-a-scm-vendor-tp5463712p5739204.html Currently I am using the EnvInject plugin to add hg to the PATH but obviously this sort of thing should be handled automatically by Jenkins. Let me know what you think.

          cowwoc added a comment -

          I believe we can close this issue because in the new Pipeline design users will need to add HG to the PATH anyway (to interact with it from a shell, etc).

          cowwoc added a comment - I believe we can close this issue because in the new Pipeline design users will need to add HG to the PATH anyway (to interact with it from a shell, etc).

            jglick Jesse Glick
            cowwoc cowwoc
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: