Faster Builds with Maven in Netbeans

Posted by Roger Keays, 2 August 2008, 3:05 AM

An often expressed lament of Java developers is the slowness of compile/deploy round-tripping. Here are a few tips to help alleviate the condition in Netbeans.

  1. Change your maven build action to compile war:exploded. The default target for the run action is package, which unnecessarily zips up the war, and copies it to your repository. You can change the build action by right clicking on the project and selecting properties.
  2. Skip tests. Even if you haven't got any actual test cases, it can still take a second or two for the build to figure that out. There is a skip tests checkbox just below where you set the build actions.
  3. Debug instead of run. It takes a little longer initially, but the debugger can compile and deploy changes to a single class with the Apply Code Changes button. It doesn't seem to allow adding, renaming, or removing methods, but still pretty handy nevertheless.