title: Permission denied when trying to execute behat in jenkins
body: <p>I try to execute behat in my jenkins server (similar to <a href="http://shaneauckland.co.uk/2013/01/integrating-behat-and-mink-with-jenkinsci/" rel="nofollow">this</a>). </p>
  
  <p>My build xml:</p>
  
  <pre><code>&lt;target name="behat" description="Execute the behat tests"&gt;
      &lt;exec command="${basedir}/bin/behat --profile jenkins -c ${basedir}/config/behat.yml"  /&gt;       
  &lt;/target&gt;
  </code></pre>
  
  <p>(Yes, my bin is at ./bin and not ./vendor/bin) </p>
  
  <p>However I get this error:</p>
  
  <pre><code>var/lib/jenkins/jobs/defTest/workspace/build.xml:116: Execute failed: java.io.IOException: Cannot run program "/var/lib/jenkins/jobs/defTest/workspace/bin/behat": error=13, Keine Berechtigung
  at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
  at java.lang.Runtime.exec(Runtime.java:617)
  at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:862)
  at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:481)
  at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:495)
  at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:631)
  at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:672)
  at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:498)
  at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
  at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:606)
  at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
  at org.apache.tools.ant.Task.perform(Task.java:348)
  at org.apache.tools.ant.Target.execute(Target.java:390)
  at org.apache.tools.ant.Target.performTasks(Target.java:411)
  at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
  at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
  at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
  at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
  at org.apache.tools.ant.Main.runBuild(Main.java:809)
  at org.apache.tools.ant.Main.startAnt(Main.java:217)
  at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
  at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
  </code></pre>
  
  <p>Caused by: java.io.IOException: error=13, Keine Berechtigung
      at java.lang.UNIXProcess.forkAndExec(Native Method)
      at java.lang.UNIXProcess.(UNIXProcess.java:135)
      at java.lang.ProcessImpl.start(ProcessImpl.java:130)
      at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022)
      ... 23 more</p>
  
  <p>("Keine Berechtigung" is German for "Permission denied") I tried to chmod the behat file to 777 but as I pull from a mercurial repository my changes seem always to be undone. </p>
  
  <p>Do you have any ideas how to fix my problem?</p>