You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Alex Vollmer <al...@tenzing.com> on 2003/04/05 03:00:02 UTC

Handling build dependencies smartly

OK, here's a good one for you clever Maven folk...

I have several CVS projects that are inter-related and change often. 
Because they change so frequently we wanted to "short-circuit" the 
normal JAR publishing and instead compile our code and put JARs directly 
into our local repository. My first crack at "Maven-izing" them was to 
create a custom Jelly goal that would figure out which dependencies were 
local (i.e. one of my other CVS projects) and get it to build those 
dependency projects and deploy their JARs in the local repository prior 
to compilation.

For example I have four projects: 'dog', 'cat', 'horse' and 'fish'. The 
dependencies look like this:

fish is a base package with no dependencies
horse depends on fish
cat depends on horse and fish
dog depends on horse, cat and fish.

I want to be able to build any one of these projects at a given moment 
and have any out-of-date source from other dependent projects compile. 
With this dependency graph the Reactor processes the 'dog' projects like 
this:

- Check that cat is up to date
    - Check that horse is up to date
       - Check that fish is up to date
          - compile fish and install in the local repo
       - Compile horse and install in the local repo
      - Compile cat and install in the local repo
- Check that horse is up to date
    - horse checks that fish is up to date
       - fish jar in local repo is up to date with fish source - take no 
action
    - horse jar in  local repo is up to date with horse source - take no 
action
- Compile dog source and install jar in local repo

Now this is a gross simplification of my real build system. You can 
imagine that projects that are referred to by lots of other projects 
(the 'fish' project in this case) are queried quite extensively causing 
my builds to be thorough (meaning no updated source is missed), but 
pretty slow.

Now since I have a rather tangled dependency tree I have to recurse 
around quite a bit to get everything to build. I'm wondering if someone 
else hasn't already run into this and solved the problem. Any ideas 
besides re-structuring my projects?

Thanks!

--Alex


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org