I am using Ant 1.7.0 2008 build and jdk 1.6 on Windows Vista Home Basic Edition OS. I am trying to compile my project using ant.
But the property file is not getting outputted in the classes folder. The folder and file organisation of my project is as follows: -
for the above structure i have made the build.xml as follows: -
I execute the ant tool as : -
The Build is successfull ... that is the Tester.class file is created in appropriate packag structure ....
but when i check the build directory which contains the classes created after compilation, then its found that the resources directory is not created, also the property file is not outputted as the resources directory is not available.
Tester.java is expected to use the property file, but currently Tester.java just contains one line of System.out.println("Hello World!"); that's it.
The structure after executing ant ...looks as follows: -
As you can see, the package structure for property file was not created.
Why does the ant task does not create the package structure for property file?
How do i make ant do that? ......So that i can refer to that in the Tester.java code later?
Thanks in advance!
Thanks and Regards
Omkar Patkar (SCJP 1.4)[url]http://javacollectionsnotes.blogspot.com[/url] | [url]http://omkar-myscjpexp.blogspot.com[/url]
I'm not sure that using the "includes" attribute means that non-Java files will be copied. If it doesn't, you'll have to move non-Java files via a copy.
Joined: Aug 25, 2005
Thank you for the reply.
Actually, in the user manual of Ant 1.7, the includes attribute has been defined as :-
includes Comma- or space-separated list of files (may be specified using wildcard patterns) that must be included; all .java files are included when omitted.
So i thought of using "includes" in my build file.
It says "list of files" .... and since i have used the wildcard "**" i thought, all directories and files will be considered.
But either my understanding is wrong and as you suggested i might have to use the "copy" task.
But in that case, does that mean for any non ".java" files, ... like ".xml" or ".properties" or ".log" or ".txt" etc.,
i will have to configure the ant build task to "copy" the files with their package structure individually ?
... is their any facility in ant that will take care of this automatically?
Sorry for the late reply, actually internet connection @ my end had problems which got resolved today.
I did search over for finding if there is any way by which, non java files with its package (directory)
structure is maintained as is when source code is compiled... but i did not get any information where ant provides a readymade facility to do so
in compile task.
Therefore, i guess, ... as per David Newton and Diptirmay Rout i will have to copy non java files along with their directories
as a copy task separately.
Thank you so much David and Diptirmay...thank you Cheers !