|
Using Ant from Hudson: set the basedir property |
|
Facts -
Other software technologies
|
|
Saturday, 05 December 2009 19:56 |
|
This article has been written based on programming with the build system Hudson version 1.336 and ant version 1.7.1.
When triggering an Ant build script from Hudson Ant did not read in my property files. The path to the property files seemed to be correct, and unfortunately ant did not give an error message when it can not find a property file.
My ant script was not located directly in the Hudson workspace directory. Instead it was in a subdirectory named "script" of the workspace directory. So Ant used this "script" directory as base directory (basedir) but in the script I had assumed that the path for the property files should be relative to the Hudson workspace directory.
It is more convenient to work with paths relative to the Hudson workspace directory than with paths relative to the "script" directory. So I added the following line to the properties section of the ant configuration of my Hudson job:
basedir=${WORKSPACE}
This overrides the base directory in my ant script with the workspace directory of my Hudson job.
Note January 2012: the Hudson built system was bought by Oracle. As a result Hudson is now maintained by new team of developers. The existing Hudson developers and most plugin developers started developing a new branch of Hudson called Jenkins.
|