Specifying java options for tests run by surefire

To specify jvm options for a test you can use argLine system property:

http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#argLine

E.g. to set max perm size to 2 GB you can do:
mvn clean install -DargLine="-XX:MaxPermSize=2g"

Advertisements

Build specified module with dependencies in Maven

Because I always forget how to do it:

mvn clean install -pl <comma separated module list> -am

From maven help:

 -am,--also-make                        If project list is specified, also
                                        build projects required by the
                                        list
 -pl,--projects                    Comma-delimited list of specified
                                        reactor projects to build instead
                                        of all projects. A project can be
                                        specified by [groupId]:artifactId
                                        or by its relative path.