title: Ant Script on Jenkins: resource does not exist
body: <p>I have a maven project, which has roughly the following structure:</p>
  
  <pre><code>sourceProject
  - src
  - distribution
  - pom.xml
  </code></pre>
  
  <p>The pom.xml is building the project and copying the source to the distribution, including dependencies, etc. The source project is committed to our repository including the empty distribution folder. </p>
  
  <p>Further downstream, I have an ant build.xml which is copying the distribution folder to a destination folder and building a zip. The relevant command is: </p>
  
  <pre><code>&lt;copy todir="${buildDirectory}/features/project/root/sourceProject"&gt;
   &lt;fileset dir="${basedir}/../sourceProject/distribution" /&gt;
  &lt;/copy&gt;
  </code></pre>
  
  <p>On my local machine everything is working just as expected. However, once I commit it to our repository the appropriate Jenkins job fails with the following exception:</p>
  
  <pre><code>org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.6:run (default) on project myProject: An Ant BuildException has occured: The following error occurred while executing this line:
  /home/jenkins/mySubProject/build.xml:48: /home/jenkins/sourceProject/distribution does not exist.
  </code></pre>
  
  <p>I assume, I need to specify the distribution in my sourceProject pom.xml, however my attempts failed so far.   </p>