In my Eclipse workspace I have 3 projects - 2 dynamic web projects and a data access layer project. What I want to do is whenever I clean (Project - Clean...) or build the dynamic web projects I want Eclipse / Ant to automatically build the jar from the DAL project and move it into the lib folder of each dynamic web project and add them to the build path. So far I've added the build.xml to 1 of the dynamic projects and this is what I have.
It's kind of working, but for some reason Eclipse is complaining about classes not found from that jar. However, when I build and add it manually to the web projects it works fine. The script also only runs when I build the project manually. Argh!!
<?xml version="1.0" ?>
<project name="dal-Main" default="CreateJar">
<target name="CreateJar" description="Create Jar file">
<jar destfile="dal.jar" basedir="." />
<move file="dal.jar" todir="./WebContent/WEB-INF/lib" />