ant javac task not copying directory with no java files
Joined: Jan 09, 2005
Writing ant script to build web application /src --compile to--> /build/WEB-INF/classes
in the source directory, there is a directory that contains no class, but it contains the ApplicationResouce.properties file
let's say it's sitting in /src/some/package/name/ApplicationResource.properties
this directory ONLY contain this file
When I am running ant javac task, all class got compiled nicely but the ApplicationResource.properties is *NOT* copied over. WHY? I tought compile would take care of that?
In eclipse, if I set the source directory to point to /src and have it compile to some directory like /build/WEB-INF/classes
the ApplicationRespurce.properties *DOES* get copied over.
Why am I still compiling via ant? because the source will be checked out in the server and compiled using ant by logging in via SSH. So I need to get ant javac to compile AND copy the ApplicationResource.properties even tho there's no .java in that directory.
Here's my ant javac task:
Restraint: I can get away by manually putting a copy task to copy over the ApplicationResouce.properties file, but what if I have 20 files? I hate to do that manually. It should does it automaticallt on compile but I'm not sure how
Settings: I'm using java 1.5.0_03, I'm running ant using javac fork=true
Compiling means "Turn Java source code into class files". Copying was NEVER part of the process, whether standalone javac or as an Ant invocation of javac.
However, the copy task can certainly do as many files as you like. People often do an exclude for "**/*.java", for example.
Myself, I prefer to keep the invariant stuff in a protype exploded WAR and just copy the whole thing over to the build directory. That included properties files, struts, JSF and Spring config files, WEB-INF/lib jars, etc. [ March 24, 2006: Message edited by: Tim Holloway ]
Customer surveys are for companies who didn't pay proper attention to begin with.
Joined: Sep 22, 2005
Zenikko, i too have faced simillar problem,i am not sure this will help u out ,try this