[Anthill] Change working directory for build

Andy Levy andy.levy at gmail.com
Wed Dec 28 08:08:45 CST 2005


I've finally tracked down where my build issues are coming from in anthill.

Background: I have a JSP/Servlet web application stored in Subversion.
 After pulling the code from Subversion, my build script in build.xml
does some checks, compiles Java console app A, executes A, then builds
the web app B.  My source tree is as follows:

working_root\
  build.xml
  conf\
    A.java
    file1.properties
  src\
    hplg\
      file1.java
  web\
    js\
    calculator.jsp

A.java compiles fine, then is executed.  It is supposed to go through
*.properties contained in the conf directory, build a properties
object, then write it out to properties.serialized which is then read
by the web app itself.

A.java looks for *.properties inside the ./conf directory.  So
presumably it's expecting to be executed as java conf\A.class from the
working_root directory.

When I do an ant compile at the command line, in the working copy that
anthill pulls down, everything runs fine.

However, when it's run from within anthill, the current directory Java
sees is c:\windows\system32 (I'm working on WinXP) and obviously it's
not going to find my conf directory there.

Is there a way to specify a directory for anthill to change to before
executing anything in my build, so that everything sees the correct
paths instead of c:\windows\system32?  If not, can it be done via
build.xml?  I can't just hardcode a path in A.java.



More information about the Anthill mailing list