tags:

views:

27

answers:

2

Hi guys, I have to refactor an ant xml file. Basicly I have one big task that checkouts (using cvs) a lot of dependencies, build them, and then copy all the jar/wsdl generated by building them to a directory that I specify. If one dependency version changes, I have to change the name in at least 3 places on the xml file (cvs checkout, build, copy).

What I'd like to have is just a single place where I can specify my dependencies name, without having to search & replace the dependency name through the code.

One of the problems is that the cvs project could be /path1/path2/project with tag=v12 but then the jars generated by the single project build could be several with different names, so it seems to be a bit complicated.

Do you have any idea on how I can get this done?

A: 

Maybe I'm misunderstanding the question, but can't you define Ant properties with each dependency's name and use the property in the 3 places? Then you just update the property value when there is a version change.

Nate
A: 

I'd recommend considering using a dependency management tool like ivy.

The use of a versioned repository will enable you to break up a large monolithic build into smaller sub-projects.

Ivy also inetgrates with the maven central repositories maintained for other open source projects which means you won't have to commit their jars into your SCM anymore, just reference them in your ivy.xml file.

Mark O'Connor