title: Integration of Ant and Github with Jenkins
body: <p>I have not found any specified links to work on integration of Jenkins with ANT and GitHub. If anybody knows, please specify.</p>
  
  <p>I want to build a war file with ANT, whenever a new change appears in GitHub, by using Jenkins.
  I am facing the following error:</p>
  
  <pre><code>Started by an SCM change
  Building in workspace C:\Program Files\Jenkins\jobs\ANTwithGitIntegration\workspace
   &gt; C:\Program Files\Git\bin\git.exe rev-parse --is-inside-work-tree # timeout=10
  Fetching changes from the remote Git repository
   &gt; C:\Program Files\Git\bin\git.exe config remote.origin.url https://github.com/swethasreeramoju/ANTGitIntegration.git # timeout=10
  Fetching upstream changes from https://github.com/swethasreeramoju/ANTGitIntegration.git
   &gt; C:\Program Files\Git\bin\git.exe --version # timeout=10
  using .gitcredentials to set credentials
   &gt; C:\Program Files\Git\bin\git.exe config --local credential.helper store --file=\"C:\Windows\TEMP\git2414419353538628866.credentials\" # timeout=10
   &gt; C:\Program Files\Git\bin\git.exe -c core.askpass=true fetch --tags --progress https://github.com/swethasreeramoju/ANTGitIntegration.git +refs/heads/*:refs/remotes/origin/*
   &gt; C:\Program Files\Git\bin\git.exe config --local --remove-section credential # timeout=10
   &gt; C:\Program Files\Git\bin\git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
   &gt; C:\Program Files\Git\bin\git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
  Checking out Revision d5143b19bc850c9e9f1d498c423fb96b777cbf55 (refs/remotes/origin/master)
   &gt; C:\Program Files\Git\bin\git.exe config core.sparsecheckout # timeout=10
   &gt; C:\Program Files\Git\bin\git.exe checkout -f d5143b19bc850c9e9f1d498c423fb96b777cbf55
   &gt; C:\Program Files\Git\bin\git.exe rev-list cfdc3ab5d2a36dfeabda376ba3dc27b2e60f2e5e # timeout=10
  [ANTRepositoryIntegration] $ cmd.exe /C '"C:\apache-ant-1.9.5\bin\ant.bat -file build.xml war &amp;&amp; exit %%ERRORLEVEL%%"'
  Buildfile: C:\Program Files\Jenkins\jobs\ANTwithGitIntegration\workspace\ANTRepositoryIntegration\build.xml
       [echo] C:\Program Files\Jenkins\jobs\ANTwithGitIntegration\workspace
  
  clean:
     [delete] Deleting directory C:\Program Files\Jenkins\jobs\ANTwithGitIntegration\workspace\ANTRepositoryIntegration\build\classes
  
  build-subprojects:
  
  init:
      [mkdir] Created dir: C:\Program Files\Jenkins\jobs\ANTwithGitIntegration\workspace\ANTRepositoryIntegration\build\classes
  
  build-project:
       [echo] ANTRepositoryIntegration: C:\Program Files\Jenkins\jobs\ANTwithGitIntegration\workspace\ANTRepositoryIntegration\build.xml
  
  BUILD FAILED
  C:\Program Files\Jenkins\jobs\ANTwithGitIntegration\workspace\ANTRepositoryIntegration\build.xml:61: srcdir "C:\Program Files\Jenkins\jobs\ANTwithGitIntegration\workspace\ANTRepositoryIntegration\.apt_generated" does not exist!
  
  Total time: 0 seconds
  Build step 'Invoke Ant' marked build as failure
  Finished: FAILURE
  </code></pre>
  
  <p>I have Generated the ANT build.xml file by File->Export->General->Buildfile.</p>
  
  <p>And Below is the code of build.xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
  &lt;!-- WARNING: Eclipse auto-generated file.
                Any modifications will be overwritten.
                To include a user specific buildfile here, simply create one in the same
                directory with the processing instruction &lt;?eclipse.ant.import?&gt;
                as the first entry and export the buildfile again. --&gt;
  &lt;project basedir="." default="build" name="ANTRepositoryIntegration"&gt;
      &lt;property environment="env"/&gt;
      &lt;echo message="${env.WORKSPACE}" /&gt;
      &lt;property name="debuglevel" value="source,lines,vars"/&gt;
      &lt;property name="target" value="1.6"/&gt;
      &lt;property name="source" value="1.6"/&gt;
      &lt;path id="Apache Tomcat v7.0 [Apache Tomcat v7.0].libraryclasspath"&gt;  
          &lt;pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 7.0/lib/annotations-api.jar"/&gt; 
          &lt;pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 7.0/lib/catalina-ant.jar"/&gt;
          &lt;pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 7.0/lib/catalina-ha.jar"/&gt;
          &lt;pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 7.0/lib/catalina-tribes.jar"/&gt;
          &lt;pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 7.0/lib/catalina.jar"/&gt;
          &lt;pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 7.0/lib/ecj-P20140317-1600.jar"/&gt;
          &lt;pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 7.0/lib/el-api.jar"/&gt;
          &lt;pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 7.0/lib/jasper-el.jar"/&gt;
          &lt;pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 7.0/lib/jasper.jar"/&gt;
          &lt;pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 7.0/lib/jsp-api.jar"/&gt;
          &lt;pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 7.0/lib/servlet-api.jar"/&gt;
          &lt;pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-api.jar"/&gt;
          &lt;pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-coyote.jar"/&gt;
          &lt;pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-dbcp.jar"/&gt;
          &lt;pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-i18n-es.jar"/&gt;
          &lt;pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-i18n-fr.jar"/&gt;
          &lt;pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-i18n-ja.jar"/&gt;
          &lt;pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-jdbc.jar"/&gt;
          &lt;pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-util.jar"/&gt;
          &lt;pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat7-websocket.jar"/&gt;
          &lt;pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 7.0/lib/websocket-api.jar"/&gt;
      &lt;/path&gt;
      &lt;path id="ANTRepositoryIntegration.classpath"&gt;
          &lt;pathelement location="build/classes"/&gt;
          &lt;path refid="Apache Tomcat v7.0 [Apache Tomcat v7.0].libraryclasspath"/&gt;
      &lt;/path&gt;
      &lt;target name="init"&gt;
          &lt;mkdir dir="build/classes"/&gt;
          &lt;copy includeemptydirs="false" todir="build/classes"&gt;
              &lt;fileset dir="src"&gt;
                  &lt;exclude name="**/*.java"/&gt;
              &lt;/fileset&gt;
          &lt;/copy&gt;
          &lt;copy includeemptydirs="false" todir="build/classes"&gt;
              &lt;fileset dir=".apt_generated"&gt;
                  &lt;exclude name="**/*.java"/&gt;
              &lt;/fileset&gt;
          &lt;/copy&gt;
      &lt;/target&gt;
      &lt;target name="clean"&gt;
          &lt;delete dir="build/classes"/&gt;
      &lt;/target&gt;
      &lt;target depends="clean" name="cleanall"/&gt;
      &lt;target depends="build-subprojects,build-project" name="build"/&gt;
      &lt;target name="build-subprojects"/&gt;
      &lt;target depends="init" name="build-project"&gt;
          &lt;echo message="${ant.project.name}: ${ant.file}"/&gt;
          &lt;javac debug="true" debuglevel="${debuglevel}" destdir="build/classes" includeantruntime="false" source="${source}" target="${target}"&gt;
              &lt;src path="src"/&gt;
              &lt;src path=".apt_generated"/&gt;
              &lt;classpath refid="ANTRepositoryIntegration.classpath"/&gt;
          &lt;/javac&gt;
      &lt;/target&gt;
      &lt;target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/&gt;
  
      &lt;target name="war" description="Bundles the application as a WAR file" depends="clean, build"&gt;
          &lt;mkdir dir="WebContent/WEB-INF/classes"/&gt;
  
          &lt;copy includeemptydirs="false" todir="WebContent/WEB-INF/classes"&gt;
                  &lt;fileset dir="build/classes"&gt;
                  &lt;include name="**/*.class"/&gt;
                  &lt;/fileset&gt;
          &lt;/copy&gt;
  
          &lt;war destfile="ANTRepositoryIntegration.war"
              basedir="WebContent"
              needxmlfile="false"&gt;
          &lt;/war&gt;
      &lt;/target&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>The project is a normal Dynamic Web Project which I am pushing it into GitHub.</p>