aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Class files generated in web-inf directory as well as in base directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Class files generated in web-inf directory as well as in base directory" Watch "Class files generated in web-inf directory as well as in base directory" New topic
Author

Class files generated in web-inf directory as well as in base directory

sri ramvaithiyanathan
Ranch Hand

Joined: Nov 20, 2010
Posts: 109
Hi,

I dont know where I am going wrong.
I have created one ant build script to generate war file.The war file successfully created.But the classes file get created in web-inf directory as well as in base directory.
Kindly correct me where I am going wrong.


For java examples,ebooks,interview questions,visit this blog
http://periodicupdates.blogspot.com/
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
Looks like this fileset would put the classes in base dir in war : <fileset dir="${classes.dir}"></fileset>

sri ramvaithiyanathan
Ranch Hand

Joined: Nov 20, 2010
Posts: 109
what change I have to do over there?
Sorry for asking this because if I comment the line <fileset dir="${classes.dir}"></fileset>
classes is not bundled in the web-inf directory as well as base dir also.
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
You can use a classes element instead of that fileset, or you could use basedir attribute. For "classes" usage, see the example at the bottom of war task documenation.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

Lines 52 and 53 cause the class files to be copied to WEB-INF/classes in the WAR because earlier, lines 40 to 43 the java source files were compiled into the ${web.dir}/WEB-INF/classes directory.

Line 54 causes the class files to be copied to the base directory of the WAR. Remove that line.


JBoss In Action
sri ramvaithiyanathan
Ranch Hand

Joined: Nov 20, 2010
Posts: 109
Peter and Carol thanks for your hard effort.
Its working fine.
Really you guys rocking .

Regards,
Sriram.V
 
wood burning stoves
 
subject: Class files generated in web-inf directory as well as in base directory