Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rebuilding the WHOLE Java application everytime I make a change

I am new to building Java web applications & WAR files. I am working with a fairly large web application that is built on Java & JSP pages. We have a ANT file that will re-build the entire application every time a single change was made. I want to know if it is possible to only re-build the part of the application that was modified instead of the whole entire project.

Testing is a 10 minute process because I will make a change, shutdown Tomcat, run the ANT script, start Tomcat, re-load application in browser which now takes 7min to do load for the first time after a re-build (I'm also curious to know what it's doing here?)...Basically complete hell for testing.

If anyone could suggest a better testing strategy I would be awesome! Also maybe anyway we would just have the ANT script re-build only modified classes.

like image 889
Sunny Patel Avatar asked May 20 '13 14:05

Sunny Patel


1 Answers

There are several things one can do.

  1. One can modify jsp in the tomcat/temp directory. The change will be available immediately without any recompiling/reloading

  2. One can use the remote Tomcat debugging (from Eclipse). This debugging allows one to change the source code and this change will be propagated to Tomcat immediately

  3. The best way to organize your ant script is to separate compiling into several jars and then creating a war file. Then recompilation for one change will happen only in one jar.

  4. It is not required to restart Tomcat under redeployment if you specify reloadable=true for the context

like image 165
Alex Avatar answered Oct 24 '22 04:10

Alex