Maven doesnt work on jenkins (but it does through eclipse and command line)
<p>I have a few tests for CI, all in maven. The builds are successful when I run them in eclipse in my local (windows 10) and when I run them through command line in ec2 linux server.</p>

<p>Only when I build same project from Jenkins I get the following error: </p>

<p><code>Waiting for Jenkins to finish collecting data[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project invalidlogin: Error while storing the mojo status: /var/lib/jenkins/workspace/project/invalidlogin/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst (Permission denied) -&gt; [Help 1]</code></p>

<p>Im using PhantomJS as browser.</p>

<p>How to make it work from jenkins? </p>

<ul>
<li>I updated permissions using chmod but I still get same results. </li>
<li>Why would this run through console but not through jenkins?</li>
</ul>

<p>this is my <code>pom</code></p>

<pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;InvalidLoginV1&lt;/groupId&gt;
  &lt;artifactId&gt;invalidlogin&lt;/artifactId&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;invalidcredentials&lt;/name&gt;
  &lt;description&gt;invalidcredentials&lt;/description&gt;

  &lt;properties&gt;
&lt;suiteXmlFile&gt;src/main/resources/testng.xml&lt;/suiteXmlFile&gt;

&lt;/properties&gt; 

&lt;dependencies&gt;
&lt;dependency&gt;
  &lt;groupId&gt;org.testng&lt;/groupId&gt;
  &lt;artifactId&gt;testng&lt;/artifactId&gt;
  &lt;version&gt;6.8&lt;/version&gt;
  &lt;scope&gt;test&lt;/scope&gt;
&lt;/dependency&gt;

&lt;dependency&gt;
    &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
    &lt;artifactId&gt;selenium-server&lt;/artifactId&gt;
    &lt;version&gt;2.34.0&lt;/version&gt;
    &lt;scope&gt;test&lt;/scope&gt;
&lt;/dependency&gt;

&lt;dependency&gt;
    &lt;groupId&gt;com.github.detro.ghostdriver&lt;/groupId&gt;
    &lt;artifactId&gt;phantomjsdriver&lt;/artifactId&gt;
    &lt;version&gt;1.0.4&lt;/version&gt;
    &lt;scope&gt;test&lt;/scope&gt;
&lt;/dependency&gt;

&lt;dependency&gt;
  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
  &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
  &lt;version&gt;2.19.1&lt;/version&gt;
  &lt;type&gt;maven-plugin&lt;/type&gt;
&lt;/dependency&gt;


&lt;/dependencies&gt;  

&lt;build&gt;


&lt;plugins&gt;

    &lt;plugin&gt;
          &lt;groupId&gt;com.github.klieber&lt;/groupId&gt;
          &lt;artifactId&gt;phantomjs-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;0.7&lt;/version&gt;
    &lt;/plugin&gt;



&lt;plugin&gt;



&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
&lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
&lt;version&gt;3.0&lt;/version&gt;
&lt;configuration&gt;
&lt;compilerVersion&gt;1.8&lt;/compilerVersion&gt;
&lt;source&gt;1.6&lt;/source&gt;
&lt;target&gt;1.6&lt;/target&gt;
&lt;/configuration&gt;
&lt;/plugin&gt;


&lt;/plugins&gt;

&lt;/build&gt;

&lt;/project&gt;
</code></pre>