FYI - I am running Jenkins 1.459 on a Mac (Snow Leopard 10.6) w/ the Mercurial plugin 1.38.
Here's a full snippet from the console output:
$ hg clone --rev default --noupdate http://perforce.mok3.com/scm/hg/EveryScape /Users/Shared/Jenkins/Home/jobs/ESSDK/workspace
ERROR: Failed to clone http://perforce.mok3.com/scm/hg/EveryScape
java.io.IOException<http://stacktrace.jenkins-ci.org/search?query=java.io.IOException>: Cannot run program "hg": error=2, No such file or directory
When I execute the same command outside of Jenkins, it works fine:
macmini_05:~ cruisecontrol$ hg clone --rev default --noupdate http://perforce.mok3.com/scm/hg/EveryScape /Users/Shared/Jenkins/Home/jobs/ESSDK/workspace
adding changesets
adding manifests
In the Jenkins configuration, under Mercurial, I have:
Installation directory: /usr/local/bin
Executable: /usr/local/bin/hg
From the shell, I can find hg:
macmini_05:~ cruisecontrol$ which hg
/usr/local/bin/hg
I happened to notice this resolved issue which may fix my problem:
https://issues.jenkins-ci.org/browse/JENKINS-11877
Unfortunately, this issue is not bundled into a plugin release yet.
Also - I attempted to fetch the source code for this plugin and build a copy myself;
however, the build was unsuccessful (apparently due to some tests failing).
How can I resolve my problem in the meantime?
Thanks,
Chuck
It appears to me that:
1. Even if you specify the full path to the Mercurial executable in the Mercurial plugin configuration - it is not used.
2. Explicitly setting the environment variable PATH in Global properties also appears to have no affect.
Once we examined the actual path used in System Information -> Environment Variables, and we created a symbolic link from /usr/bin/hg (a directory in Jenkins runtime path) to the actual installation path, the Mercurial plugin (and my project) worked fine.
Chuck