how come ANT javac command adds extra directories? -


To begin simplifying Java implementation I am starting to study ATT today. I have written simple ANT script which only uses the javac command.

What I'm trying to do is ..... \ head_first \ src \ com \ masatosan \ constant .java (source)

in the destination directory :

..... \ head_first \ WEB-INF \ classes \ com \ masatosan \ conf

Then the result will look like this:

..... \ head_first \ WEB-INF \ classes \ com \ masatosan \ conf \ constant class

But I can not understand that Why does the actual result connect "/ com / masatosan / conf" to the destination folder , then it looks like:

C: \ Program Files \ Apache Software Foundation \ Tomkat 6.0 have \ Vebaps \ head_first \ WEB-INF \ classes \ com \ masatosan \ conf \ com \ masatosan \ constant.class

Can someone tell me that I can how to fix it?

AN

  & lt; Name of the project = "compile mesatosan" basedir = "C: \ Program Files \ Apache Software Foundation \ tomcat 6.0 \ webapps \ head_first \ src \ com \ masatosan" & gt; & Lt; Description & gt; Musatan Compiler & lt; / Description & gt; & Lt; Property Name = "confSrc" location = "C: \ Program Files \ Apache Software Foundation \ Tomcat 6.0 \ webapps \ head_first \ src \ com \ masatosan \ conf" / & gt; & Lt; Property name = "confDest" location = "C: \ Program Files \ Apache Software Foundation \ tomcat 6.0 \ webapps \ head_first \ WEB-INF \ classes \ com \ masatosan \ conf" /> & Lt; Target name = "compile config SRC" & gt; & Lt; Javac srcdir = "$ {confSrc}" destdir = "$ {confDest}" /> & Lt; / Target & gt; & Lt; / Project & gt;  

UPDATE

I did not know that the package creates a conifer directory based on the name.

Continuous of the name of the package Java was com.masatosan.conf so that the compliant "/ com / masatosan / conf /"

Trying to tell ANT to change because you want to be consistent with the com.masatosine package instead of com.masatosan.conf package. The ant compilation process will create the appropriate package subdirectories, which is why you prepare com \ masatosan under the Dest.

I do not think you can ask ANT to change the package of a source file, which is what you are trying to do through an additional conf dir injection, you either make a conf dir And can do a conf \ com \ masatosan \ constants.class or keep it under classes \ com \ masatosan \ constants.class , but you can Can 'Do not do com \ masatosan \ conf \ constants.class because it changes the package of constant. com.masatosan.conf

Or just change the package of contacts into the com \ matsatos \ conf and change your ent file to:

& lt; Property name = "confDest" location = "C: \ Program Files \ Apache Software Foundation \ tomcat 6.0 \ web apps \ head_fst \ WEB-INF \ classes" />


Comments