Poor/Slow Unit Testing Performance with Maven

January 5, 2011

Our development struggled for some time as the application was getting bigger and bigger, the performance of unit testing got really bad becoming at some point (especially after migrating to latest Hibernate 3.6) unusable (aka stop of quality development) 😦

We investigated the environment (jdk, hw specs, ram), the frameworks being used (Hibernate, Spring), even the underlying DB (I am actually here talking of integration tests)… but the answer was to be found in the Maven settings.

The Maven Surefire Plugin instantiates a new JVM for running the test classes, but it appears that the JVM settings of Maven (typically what you set in the bin/mvn.bat) are not propagated to the newly created JVM, hence running the tests with some (inadequate) default values…

Check this out to see how the JVM memory settings can be configured. It did the trick 🙂



Creating a Maven archetype (Struts2/Spring based web application)

February 18, 2009

An archetype in Maven is a template (predefined package structure, resources, configuration files, source files, etc…) which can be used to start the development of a new application.

Amongst various benefits I like the possibility to provide the developers with a set of resources and classes (implementations!) which are going to be needed in the new project. This speeds up the project-setup time and facilitates the adoption of best practises employed within the team.

BTW Maven has few out-of-the-box archetypes (quickstart application, web application, mojo plugin), plus you can find a variety of archetype for lots of frameworks/technology (Struts2, Spring, GWT, etc…).

Here is a list of available archetypes (docs.codehaus.org).

Create a new archetype

The following sections go through the steps of creating a Maven archetype for a web application based on Struts2, Spring and Hibernate (and set of other utilities).

Read the rest of this entry »

Maven Tips & Tricks – Extension

June 11, 2008

Just added 3 more topics. Check it out: Maven Tips & Tricks.

Maven Tips & Tricks – Part 1

May 25, 2008

Check this out: Maven Tips & Tricks.

It is my collection of tips, notes, workarounds and good practices about using Maven 2 and some of its plug-ins. Hopefully a good way to start with the tool and get around some of the initial effort required by the configuration of the POM, plug-ins and various settings.

This is just a start (5 topics) but the goal is to add more samples and notes later, making it (possibly) a good reference.