I start studying ANT today in order to make Java compiling easier.
I wrote simple ANT script which only use javac
command.
What I am trying is compile from .....\head_first\src\com\masatosan\constant.java (source)
to the destination directory:
.....\head_first\WEB-INF\classes\com\masatosan\conf
So the result would look like:
.....\head_first\WEB-INF\classes\com\masatosan\conf\constant.class
But I can't figure out why the actual result adds "/com/masatosan/conf" directories to the destination folder, so it looks like:
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\head_first\WEB-INF\classes\com\masatosan\conf\com\masatosan\constant.class
Could anyone tell me how can I fix this?
ANT
<project name="CompileMasatosan"
basedir="C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\head_first\src\com\masatosan">
<description>
masatosan compiler
</description>
<property name="confSrc"
location="C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\head_first\src\com\masatosan\conf" />
<property name="confDest"
location="C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\head_first\WEB-INF\classes\com\masatosan\conf" />
<target name="compileConfSrc">
<javac srcdir="${confSrc}" destdir="${confDest}" />
</target>
</project>
UPDATE
I didn't know complier creates directories based on the package name.
The package name of constant.java was com.masatosan.conf so that complier creates "/com/masatosan/conf/"