How can I speedup Java web application compilation?

compilation, jakarta-ee, java

Solution

Differentiate the build, and building during development.

- For the build use a dedicated build system, like Maven or Ant.

- For building during development setup your IDE to automatically compile classes (on save) and send them directly on your application server / servlet-container, so that they are hot-swapped.

Thus it won't matter how long does it take to make the build.

As of how to reduce the build-time, it depends on the build-technology you are using.

Problem

I have just started work on an existing Java web application and I find that it takes about 5-10 minutes for the application to compile and run. What are the common ways to reduce this time? It is my first time working on an application of this size. I am used to coding and testing incrementally and find this wait unbearable. Any help would be appreciated. EDIT: I am using Maven as my build system.

Original source