I’ve got an Ant built script that works fine for building a WAR file from Eclipse, and using ant from the command line.
When I try and build the WAR from Hudson, the WAR is assembled, but certain files aren’t in their right places.
What could be causing this?
I’m using ANT 1.8.2, and Hudson 3.0.0, as per my requirements.
For me, it seems there were 2 problems:
1) The “basedir” needed to be passed from Hudson to my ANT build script. To do this, I had to ensure that all project folder and file references in my project were prefixed with the “basedir” variable, and then I configured Hudson to set this variable in it’s ANT launch configuration:
Add the following in Hudson: Job Configurations | Build | Invoke ANT | Properties:
2) I needed to change some of my ANT “copy” tasks to explicitly overwrite files if already present:
This seemed to work:
became: