Take the 2-minute tour ×

So I've come to a point when I need to speed up the build process of my projects cause the way I'm doing it now is not very logical I think. I've a /lib folder within each project's folder with basically almost the same jars and each /lib folder's jar's are referenced to appropriate project in Eclipse (3.5). I use a Ant script to clean, build and create the jar for each project and have the class path in Ant set to the /lib folder so that the build would be successful.

<property name="dir.lib" value="lib" />
<path id="classpath">
    <fileset dir="${dir.lib}" includes="*.jar" />

Then there is a thing that one of the projects depend on another project in the work space. I've them linked in Eclipse, but to build successfully with Ant I need to first build the projects individually and place the project jars in the /lib folder of the project who depends on it. So it all takes quite time..

I see that I've a repository of jars on server (but it's outdated and they haven't left any ivy configurations) so maybe the best thing to do would be to get the jars from server repository when doing builds? And then publish the newly created jars on server repository?

What should I do? And how can it be done?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

I agree with WhiteFang32 - using Maven build with parent project and modules will make managing dependencies easier. However, if you have lot of dependencies that are being built from your local projects and you do not have (do not want to create and manage) a repository then ANT with cusom targets is the best and the simpliest solution. Generally the build process can be divided toi following stages:

  1. Clean output directories
  2. Update\build dependencies
  3. Copy dependencies into one central location
  4. Compile the main project
  5. Package the main project

The following article can help you to achieve the goals mentioned in 2 and 3 above by simple ANT scripting. http://www.exubero.com/ant/dependencies.html

Good luck! Aviad

share|improve this answer
add comment

You might want to consider using Maven for builds and dependency management. There's a plugin for Eclipse to make it easier to setup and seamless to deal with linking jars.

If you need to stick with your Ant scripts, Ivy is still an option and has its own plugin for Eclipse. You'll still have to create the configurations though and wire the projects together. You can use the <ivy:publish> Ant task to place built jars in your local repository. Then configure Ivy to reference that repository when looking for dependencies.

share|improve this answer
add comment

Your Answer


