views:

114

answers:

1

We've got a parent project and a child project java builds using ant and ivy. The child project needs to be able to build independently.

When the parent project calls the child project the antfile command - the parent project's ivy.xml overrides the child project's ivy.xml

Does anyone know how to keep the child project using its own ivy.xml?

A: 

I'm guessing that ivy is picking up the ivy file from the default location, which would be in the same directory as the build file.

One approach would be to explicitly set the ivy file's location:

<ivy:resolve file="path/to/ivy.xml"/>

A better approach would be to figure out the base directory location for your child build. How are you invoking child project? Are you using the subant or the ant ANT task?

If it is the latter make sure to use the dir attribute:

<ant dir="subproject"/>

This will specify the base dir for the child project.

Mark O'Connor