You are previewing Maven: The Definitive Guide.

Maven: The Definitive Guide

Cover of Maven: The Definitive Guide by Sonatype Company Published by O'Reilly Media, Inc.

Working with Maven Projects

The m2eclipse plugin also provides a set of features for working with Maven projects once they are inside Eclipse. Many features make Maven in Eclipse easier to use, so let’s dive right into them. In the previous section, I materialized a Maven project and selected a subproject from the Apache Camel project named camel-core. We’ll use that project to demonstrate these features.

By right-clicking on the camel-core project and selecting the Maven menu item, you can see the available Maven features. Figure 14-17 shows a screenshot of this.

Available Maven features

Figure 14-17. Available Maven features

Notice in Figure 14-17 the available Maven features for the camel-core project, including:

  • Adding dependencies and plugins

  • Updating dependencies, snapshots and source folders

  • Creating a Maven module

  • Downloading the source

  • Opening Project URLs such as the Project Web Page, Issue Tracker, Source Control, and Continuous Integration tool

  • Enabling/disabling workspace resolution, nested Maven modules and dependency management

These features are also big timesavers, so let’s review them briefly.

Adding and Updating Dependencies and Plugins

Let’s say we’d like to add a dependency or a plugin to the camel-core POM. For the sake of demonstration, we’re going to add commons-lang as a dependency. (Please note that the functionality for adding a dependency and a plugin is exactly the same, so we’ll demonstrate ...

The best content for your career. Discover unlimited learning on demand for around $1/day.