Wednesday, March 13, 2013

Install and Configure Maven in Eclipse

Installation

  1. Install and Configure Maven
    1. Download and unzip the Maven zip file into the installation directory.  For example, in Windows, it could be c:\maven, or /usr/local/maven in Linux.
    2. Add the following environment variables:
      1. M2_HOME
        The installation directory of Maven, e.g. c:\maven in Windows.
      2. M2
        The bin directory under the Maven installation directory, e.g. %M2_HOME%\bin.

  2. Install Maven plugin in Eclipse
    1. In Eclipse, add a new software site in "Help" -> "Install New Software…".  Next to the "Work with" dropdown list, press the "Add…" button.
    2. In the popup dialog (see Figure 2), input the followings:
      Name: Maven Location: http://m2eclipse.sonatype.org/sites/m2e
      Figure 2: Add a software site for installing new software/plugin
    3. Select the newly added Maven site from the “Work with” dropdown list.
    4. Check the option “Maven Integration for Eclipse (Required)” from the list (see Figure 3).
    5. Press the “Next” button.

    Figure 3: Available Software in Eclipse

References

  1. Maven, http://maven.apache.org/

No comments:

Post a Comment