Greg Speechley wrote:
During development we use a java editor eg jGrasp to edit .java files which
are stored in $CATALINA_HOME\webapps\app\WEB-INF\classes and compile these
individually. It gets a bit tiresome restarting tomcat after each recompile
but I can live with that (I have reloadable=true but this doesn't seem to be
reliable). Obviously this is a fairly poor way to do things so I am keen to
use the manager in 4.1.24 to reload apps and ant to build it. I have looked
at the docs and created the directory structure as suggested in the
Application Developer's guide (java files in src\WEB-INF\classes, etc) and
can build from src directory so that class files are stored in the
build\WEB-INF\classes. BTW this dir structure should be stored in folder
called "projectname" somewhere other than $CATALINA_HOME\webapps?

Now from what I can tell I would then have to move these class files to
$CATALINA_HOME\webapps\app\WEB-INF\classes to be able to test it, surely I
am missing something because this seems to be quite laborious. Do you use
ant each time you recompile during development or just compile from your
editor? If anyone can provide some suggestions on the recommended way to do
things I would greatly appreciate it coz I am trying to implement much
better development practices :)

I think ant is pretty great. Although compiling a class from my IDE is fine for just messing around or during initial scratchwork, once I have an ant file built I *never* perform any compiling, copying, or deployment without it. Every time I add new code I run ant, which puts the code through unit tests before determining whether or not it should go to deployment. And with a simple property change, I can have the app compiled into a JAR/WAR instead.


I have read only a handful of the chapters in "Java Development With Ant" by Hatcher and Loughran, and I have already learned tons of great tips for using ant, such as conditional compilation (so that I don't have to redeploy the -entire- app if I just want to make a small change to an auxillary package, etc), generating unit test reports in nice HTML files, and overall fine-tuning the build process.

Note also that I am using ant quite happily for my non-webapp Java project as well.


Erik



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to