Maven Integration for Eclipse( M2Eclipse) – Plugin Installation

I was looking for Maven eclipse plugin for a while, M2Eclipse suits to my requirement.

Steps for M2Eclipse installation in Eclipse 3.5.x.

  1. Open Help->  Install New Software…
  2. Click Add
  3. Enter Name as M2E & Location as http://m2eclipse.sonatype.org/sites/m2e/ (for Eclipse 3.5 & 3.6)
    1. For Eclipse 3.4 – http://m2eclipse.sonatype.org/sites/m2e-e34/
  4. Follow rest of instructions and complete the installation.
  5. After successful installation, verify that Maven menu is displayed in Windows ->Preferences.
  6. Set the User Settings(Maven -> User Settings) to point to right settings.xml

Once all are set, we can create a Maven project using File -> New -> Projects… > Maven -> Maven Project.

Follow the default options and create it. Maven may update the indexes by fetching it from the repositories. Allow them to continue to work in the background so that we can get to know about available groups, artifacts ids from the repository(s).

Now the new maven project is set, we can able to add dependencies, plugin etc by Right click -> Maven.

We can perform maven operations like install, clean, build etc by Right click maven project -> Run As.

Sometimes we don’t want our artifacts to be updated every time fetching from the repositories, We can set Maven to offline to achieve it through Windows -> Preferences -> Maven -> Choose Maven offline enabled.

That’s all.

Advertisements

Required artifact is missing in Maven

Check for the followings

  1. Check your proxy settings in conf/settings.xml.
  2. Try removing <mirror> if present in conf/settings.xml.
  3. Browse to the maven repository url and ensure required artifacts are present.
  4. Ensure you have proper <repository> configured in pom.xml (not recommended) (or) define your custom profile with repository defined and activated in conf/settings.xml.