Compiling Your Java Sources

The goals for the Compiler Plugin are bound to their respective phases in the build lifecycle. So to compile your sources, you need only to tell maven until which lifecycle to execute. The following will compile your sources:

mvn compile

To compile your test sources, you'll do:

mvn test-compile

The above command will execute both compiler:compile and compiler:testCompile since the compile phase happens a few phases before the test-compile phase.

Configuring Your Compiler Plugin

Since the Compiler Plugin executes automatically during their phases, you don't have to put executions unlike many other plugins. However, you should specify the version of the Compiler Plugin.

            <!-- put your configurations here -->

Note: Maven 3.0 will issue warnings if you do not specify the version of a plugin.