title: Building dependent projects using Jenkins
body: <p>Lets say i have 3 ANT projects each with its build.xml script located at the top level folder</p>
  
  <pre><code>proj1
   file1.java
  proj2
   file2.java
  proj3
   file3.java
  </code></pre>
  
  <p>I configured Jenkins to build these 3 projects and it builds them and stores the output in three separate folders. </p>
  
  <pre><code>/output/proj1/2012-02-28_20-11-06/proj1/distribution/proj1.jar
  /output/proj2/2012-02-28_20-11-08/proj2/distribution/proj2.jar
  /output/proj3/2012-02-28_20-11-09/proj3/distribution/proj3.jar
  </code></pre>
  
  <p>The ANT script is the one that puts the jar file in the distribution folder. I want to use these jar files in another project which produces a war file. </p>
  
  <p>The jar files that are generated in each project are used to build a WAR file. Is there any way i can configure Jenkins to build proj1, proj2, proj3 then copy the jar files to a specific location which will contain another ANT project which when run will produce a war file? Or does this have to be coded with ANT?</p>
  
  <p>Also, is it possible to configure jenkins to do multiple checkouts before running the ANT build script. I am using CVS and would like to do 3 checkouts each using a different tag before running the build. </p>
  
  <h2>Edit</h2>
  
  <p>I posted the question last night before i went to bed. Reading it again today i think it is not clear enough so i will clarify the requirement again. I have 4 projects that use ANT as the build mechanism and are all stored in a CVS repository. All 4 projects when built form a WAR file that is deployed on a Tomcat application server. </p>
  
  <pre><code>proj1
   - file1.java
   - file2.java
  
  proj2
   - file3.java
   - file4.java
  
  proj3
   - file3.java
   - file4.java
  
  proj4
    - jsp
      - home.jsp
   - css
      - home.css
    - WEB-INF
       - lib
       - classes 
      - web.xml
  </code></pre>
  
  <p>Each project (except proj4) has an ANT build file which builds the project and produces a JAR file which it stores in a 'distribution' folder on the root folder of the project. For example after proj1 is built it will look like this</p>
  
  <pre><code>proj1
   - file1.java
   - file2.java
   - distribution
        - classes
             - file1.class
             - file2.class
        - proj1.jar
  </code></pre>
  
  <p>Proj4 has a dependency on proj1, proj2 and proj3 in that it first needs to copy all the jar files into its workarea before it builds a war file. The ANT build file for project4 copies the JAR files from proj1, 2 and 3 and builds a WAR files. The resulting WAR file contains the following structure</p>
  
  <pre><code>proj4
    - jsp
      - home.jsp
   - css
      - home.css
    - WEB-INF
      - lib
         - proj1.jar
         - proj2.jar
         - proj3.jar
      - classes 
      - web.xml  
  </code></pre>
  
  <p>Now to automate the above i need to somehow configure Jenkins and ANT to do the following (in the order shown)</p>
  
  <pre><code>- Checkout proj1 from CVS using RELEASE1.1 tag
  - Build proj1
  
  - Checkout proj2 from CVS using RELEASE1.2 tag
  - Build proj2
  
  - Checkout proj3 from CVS using RELEASE1.1 tag
  - Build proj3
  
  - Checkout proj4 from CVS using RELEASE1.1 tag
  - Copy the proj1.jar, proj2.jar, proj3.jar from the previous 3 builds and copy them to the proj4 WEB-INF/lib folder.
  - Build proj4
  - Deploy the WAR file. 
  </code></pre>
  
  <p>I played around with Jenkins yesterday and managed to configure it to build each of the projects but each jar file ends up in an unrelated folder. How can i configure Jenkins to build the projects as i've described above? </p>
  
  <p>The environment has the following properties</p>
  
  <pre><code>Build tool - ANT
  OS - Solaris
  </code></pre>
  
  <p>Maven would probably work with this but at the moment there are no plans to introduce Maven. If there is a simple Maven like build tool that i can use to just store the libraries i need that does not require external access then please let me know. </p>
  
  <p>Thanks in advance.</p>