wood burning stoves 2.0*
The moose likes Ant, Maven and Other Build Tools and the fly likes Passing current directory to Ant script located elsewhere Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Passing current directory to Ant script located elsewhere" Watch "Passing current directory to Ant script located elsewhere" New topic
Author

Passing current directory to Ant script located elsewhere

steve claflin
Ranch Hand

Joined: Dec 04, 2008
Posts: 54
I have an ant script, located in a fixed location that includes a Java class that it runs. I want the Java class to process files in whatever directory I launched ant from (I provide the path to build.xml when I launch it). It seems that the ant's concept of "." is the location of build.xml, so what captures the knowledge of where the command prompt is? (like that ~dp0 thing in a cmd file ...)
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Try ${user.dir}


JBoss In Action
steve claflin
Ranch Hand

Joined: Dec 04, 2008
Posts: 54
Works like a charm - thanks!
 
Don't get me started about those stupid light bulbs.
 
subject: Passing current directory to Ant script located elsewhere
 
Similar Threads
Ant script(build.xml) for 'C' code base build purpose?
Error while executing build.xml
New version of Ant and Assignment 3b
Ant script src\src does not exist
(ANT) Error: No source files and no packages been specified