title: How to get Jenkins working with binaries from a subfolder of the root user?
body: <p>In my <code>build.xml</code> I defined some jobs, that should be executed by tools, I <a href="https://getcomposer.org/doc/03-cli.md#global" rel="nofollow noreferrer">installed <code>global</code>ly</a> via <a href="http://getcomposer.org/" rel="nofollow noreferrer">Composer</a>. That means, the binaries are stored in <code>/root/.composer/vendor/bin/</code> (I'm working as <code>root</code> on my local VM).</p>
  
  <p>I set the <code>PATH</code> environment variable in the composer configs (without it the build process was <a href="https://stackoverflow.com/questions/36430948/how-to-get-jenkins-working-with-binaries-from-composer-home-bin/36462122">failing</a>):</p>
  
  <p><img src="https://i.stack.imgur.com/ofzo1.png" alt="enter image description here"></p>
  
  <p>Now the building process is running in permission issues:</p>
  
  <pre><code>Started by user anonymous
  Running as anonymous
  Building in workspace /path/to/myproject
  [myproject] $ ant
  Buildfile: /path/to/myproject/build.xml
  
  phpcs:
  
  BUILD FAILED
  /path/to/myproject/build.xml:30: Execute failed: java.io.IOException: Cannot run program "phpcs": error=2, No such file or directory
      at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
      ...
      at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
      ... 24 more
  
  Total time: 0 seconds
  Build step 'Invoke Ant' marked build as failure
  Finished: FAILURE
  </code></pre>
  
  <p>The binaries in <code>COMPOSER_HOME/bin</code> are executable for everyone:</p>
  
  <pre><code>root@ubuntuvm:~# chmod 777 /root/.composer/vendor/bin/
  root@ubuntuvm:~# ls -lia /root/.composer/vendor/bin/
  total 8
  ...
  29651 lrwxrwxrwx  1 root root   42 Feb 17 14:49 phpcs -&gt; ../squizlabs/php_codesniffer/scripts/phpcs
  ...
  </code></pre>
  
  <p>I've installed the <a href="https://wiki.jenkins-ci.org/display/JENKINS/Authorize+Project+plugin" rel="nofollow noreferrer">Authorize Project plugin</a> and tried to run the build "as the user who triggered the build", but it didn't help.</p>
  
  <p><img src="https://i.stack.imgur.com/KHngO.png" alt="enter image description here"></p>
  
  <p>But that seems not to be enough.</p>
  
  <p><strong>How to give resolve these permissions problems and get Jenkins working with binaries of <code>global</code>ly installed Composer packages?</strong></p>