tags:

views:

22

answers:

1

We have a project that includes all of our re-usable classes, third-party library JARs and what not. This project is basically just where ALL of the dependencies for every project we are working on. We may only use ant and we may not use Ivy unfortunately. So for example:

./Common-Project (includes all dependencies
  -build.xml (will build this project, the dependencies, and package them all into 1 jar)

./Actual-Project (just one of many projects)
  -build.xml (will call the build.xml in common and ensure it gets the latest jar and then copy that jar into its own deployment EAR)

The problem with this is that when we build all of the actual projects (say all 10 of them, or 40, or whatever it grows to) we end up building the common-project each time.

So, here is what I want to know.... how can I package this dependency and make sure it is in fact up to date, but without constantly rebuilding it? I'm open to any suggestions (as long as it is just ant we are doing).

+1  A: 

By default, javac ant task is executed only for updated/new sources. IIRC, there's a similar principle for building jars. So, normally it shouldn't be a problem for you.

But the problem may arise if you remove existing jar or .class files before each build. In this case, it will be repeated from scratch.

Nikita Rybak
Good point. I wonder if I can/should get rid of the cleanAll task.
Zombies
Yeah, that seems like a first thing to try to me.
Nikita Rybak