wood burning stoves 2.0*
The moose likes Ant, Maven and Other Build Tools and the fly likes referencing folders from within build.xml 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 "referencing folders from within build.xml" Watch "referencing folders from within build.xml" New topic
Author

referencing folders from within build.xml

Jan Groth
Ranch Hand

Joined: Feb 03, 2004
Posts: 456
hello,

my application is reading a config file. it's located in a subfolder named "config":



1. if i compile & run a test class from within my ide, i have no problems reading the file and setting the properties.

2. if i use a ant task for running the same test, my property reader throws a FileNotFoundException. if i set the path like shown in next line, it works.



looking into the build.xml, it seems to me like if ant is referencing relative to the testbuild directory. obviously that's not what i want... :-(



does anyone have an idea about changing this behaviour in ant?

many thanks in advance,
jan.
Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
Ant will always reference files from the path relative to where ant is executed from.

Have you tried using an absolute path, such as "c:\_development\java\projects\certification" ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: referencing folders from within build.xml
 
Similar Threads
Runnig junit in App server
ANT issues - Unable to create JUnit Reports- Please help
Ant + Junit + Log4J Problem
Junit test fails only when called from ant
Ant - the junit task: can load TestCases from jar ?