aspose file tools*
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 53
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: 5772
    
    7

Try ${user.dir}


JBoss In Action
steve claflin
Ranch Hand

Joined: Dec 04, 2008
Posts: 53
Works like a charm - thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing current directory to Ant script located elsewhere
 
Similar Threads
New version of Ant and Assignment 3b
Error while executing build.xml
(ANT) Error: No source files and no packages been specified
Ant script src\src does not exist
Ant script(build.xml) for 'C' code base build purpose?