Developing with Eclipse and Maven

4.2. Running Maven Builds

4.2. Running Maven Builds

m2eclipse modified the Run As... and Debug As... menus to allow you to run a Maven build within Eclipse. Figure 4.2, “Running an Eclipse build with Run As..” shows the Run As... menu for an m2eclipse project. From this menu you can run one of the more common lifecycle phases like clean, install, or package. You can also load up the Run configuration dialog window and configure a Maven build with parameters and more options.

Running an Eclipse build with Run As..

Figure 4.2. Running an Eclipse build with Run As..


If you need to configure a Maven build with more options, you can choose Run Configurations... and create a new Maven build. Figure 4.3, “Configuring a Maven Build as a Run Configuration” shows the Run dialog for configuring a Maven build.

Configuring a Maven Build as a Run Configuration

Figure 4.3. Configuring a Maven Build as a Run Configuration


The Run configuration dialog allows you to specify multiple goals and profiles, it exposes options like "skip tests" and "update snapshots", and allows you to customize everything from the project to the JRE to the environment variable. You can use this dialog to support any custom Maven build that you wish to launch with m2eclipse.