Dependencies

This section explains how to use the Maven 2 Menu options that pertain to dependencies. Specifically, the Eclipse Integration plugin includes the following options:

  • Enabling/Disabling Dependency Management
  • Managing Dependencies
  • Viewing a Dependency Graph

    For each option, there is a corresponding sub-section with details.

Use Maven Dependency Management

The Maestro Eclipse Integration Plugin lets you manage dependencies through Eclipse or through Maven. The table, below, explains how you choose between Eclipse and Maven.

Dependency Management Through Maven

If: Then:
Maven Dependency Management is enabled, Maven uses information inside the pom.xml file to conduct dependency management. Changes to the pom.xml file will trigger a change in the Eclipse project classpath.
Maven Dependency Management is disabled, Eclipse handles dependency management as usual.

To enable or disable Maven dependency management:

  1. In the Package Explorer window, right-click on the folder that contains your project, then select Maven 2 to display the Maven 2 Menu options.
  2. Select Use Maven Dependency Management. A check mark beside the option indicates that Maven dependency management is enabled, otherwise, disabled.

Managing Dependencies

The Manage Dependencies option on the Maven 2 Menu from the allows you to view and edit dependencies inside a project.

  1. In the Package Explorer window, right-click on the folder that contains your project, then select Maven 2 to display the Maven 2 Menu options. A window opens, showing a list of all project dependencies. From this window, you can choose to add, edit, or remove dependencies.
  2. The following table explains the steps for adding, editing, or removing dependencies:

    Manage Dependencies

    To do this: Follow these steps:
    Add project dependencies, 1. Click New.
    2. In the window that opens, fill in the Group ID, Artifact ID, Version, Scope, Type, Classifier, and System Path. Or click ... to search.
    3. Click OK to close the window and create the new dependency.
    Edit a project dependency, 1. Click to select the dependency that you would like to edit.
    2. Click Edit. Or click ... to search.
    3. In the window that opens, make any changes you want to the dependency.
    4. Click OK to accept the changes and close the window.
    Search for a dependency, 1. While in Add or Edit, click ...
    2. In the window that opens, fill in the text for the Group ID, Artifact ID, or Version you would like to locate in your local repository.
    3. Click Search. Your local Maven repository will be searched, which is typically located here: [user_home]/.m2/repository.
    4. Click on the artifact you would like to use.
    5. Click OK to use the selected artifact and close the window.
    Remove a project dependency, 1. Click to select the dependency you would like to remove.
    2. Click Remove.
    3. Click OK to accept the removal and close the window.