Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

referencing folders from within build.xml

 
Jan Groth
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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" ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic