349

I have spent been on the Maven site reading the 5- and 30-minute tutorials, and trialing Maven out for the first time.

I want to install a Maven plugin and use it to start building Maven projects from Eclipse.

Despite an honest effort, I have been unable to find a comprehensive tutorial on any Maven plugin. M2E, which seems like the de facto standard, has nothing but broken (or recursive) links on their site.

I can't tell if I even installed the plugin correctly, or how to use it.

Does anyone know of a good step-by-step guide to M2E or any other plugin? One that comes with good installation documentation, along with a solid explanation of its features and proper uses?

TylerH
  • 20,799
  • 66
  • 75
  • 101
IAmYourFaja
  • 55,468
  • 181
  • 466
  • 756
  • 20
    I'm in the same boat!, glad you posted this question.. I see this was a few days ago.. where you able to get it working? I already installed maven on my machine but I haven't been able to install the plugin yet. – david Jan 05 '12 at 17:45
  • 2
    If you use Eclipse Juno J2EE m2e is already included. – Deanna May 12 '13 at 15:10
  • 1
    @KellySFrench please don't reopen off-topic questions such as tutorial requests. – TylerH Apr 05 '17 at 15:08

13 Answers13

559

(Edit 2016-10-12: Many Eclipse downloads from https://eclipse.org/downloads/eclipse-packages/ have M2Eclipse included already. As of Neon both the Java and the Java EE packages do - look for "Maven support")

Way 1: Maven Eclipse plugin installation step by step:

  1. Open Eclipse IDE
  2. Click Help -> Install New Software...
  3. Click Add button at top right corner
  4. At pop up: fill up Name as "M2Eclipse" and Location as "http://download.eclipse.org/technology/m2e/releases" or http://download.eclipse.org/technology/m2e/milestones/1.0

  5. Now click OK

After that installation would be started.

Way 2: Another way to install Maven plug-in for Eclipse by "Eclipse Marketplace":

  1. Open Eclipse
  2. Go to Help -> Eclipse Marketplace
  3. Search by Maven
  4. Click "Install" button at "Maven Integration for Eclipse" section
  5. Follow the instruction step by step

After successful installation do the followings in Eclipse:

  1. Go to Window --> Preferences
  2. Observe, Maven is enlisted at left panel

Finally,

  1. Click on an existing project
  2. Select Configure -> Convert to Maven Project
Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
  • 5
    I have tired these steps but not install, I got some error which detail below......Cannot complete the install because one or more required items could not be found. Software being installed: m2e - Maven Integration for Eclipse (includes Incubating components) 1.5.0.20140606-0033 (org.eclipse.m2e.feature.feature.group 1.5.0.20140606-0033) – Krunal Patel Oct 06 '14 at 06:31
  • @Krunal Patel: have you tried from Marketplace? – Ripon Al Wasim Oct 13 '14 at 06:21
  • I have the same Cannot complete the install because one or more required items could not be found. Software being installed: m2e - slf4j over logback logging (Optional) 1.5.0.20140606-0033 (org.eclipse.m2e.logback.feature.feature.group 1.5.0.20140606-0033) - didn't see the marketplace option under help. – Diego Oct 21 '14 at 00:44
  • 4
    Eclipse juno doesnt support maven 1.5..still they have not added capability of 1.5 so try 1.4 or 1.3 http://download.eclipse.org/technology/m2e/releases/1.3 http://download.eclipse.org/technology/m2e/releases/1.4 – Alvin Mar 03 '15 at 06:47
  • Thanks for such a great description but I am not able to install maven either way. Error saying that "Cannot satisfy dependency:" and "annot complete the install because one or more required items could not be found.". I am not sure what's the issue. Please help. – Kushal Jayswal Nov 19 '15 at 12:19
  • Did you try "Eclipse Marketplace" for maven installation? – Ripon Al Wasim Nov 19 '15 at 13:07
  • In Eclipse Neon - there is no **Window -> Preferences**, option – arober11 Jul 21 '16 at 10:35
  • Preferences may be present in other place instead of Window menu – Ripon Al Wasim Jul 22 '16 at 05:03
  • This answer, while being relevant in 2012, is no longer working in the year 2018. See answer from the year 2017 below for something that appears to work – Captain Fantastic Mar 07 '18 at 20:08
  • In Eclipse Neon.3 J2EE Maven is already included. To check -> Go to Windows -> Preferences OR File -> New -> Maven Project – Atul May 28 '19 at 11:35
37

IF you want to install Maven in Eclipse(Java EE) Indigo Then follow these Steps :

  1. Eclipse -> Help -> Install New Software.

  2. Type " http://download.eclipse.org/releases/indigo/ " & Hit Enter.

  3. Expand " Collaboration " tag.

  4. Select Maven plugin from there.

  5. Click on next .

  6. Accept the agreement & click finish.

After installing the maven it will ask for restarting the Eclipse,So restart the eclipse again to see the changes.

Mukesh Kumar
  • 371
  • 3
  • 2
  • 1
    Thanks a lot.. I had tried all the option gven above but none worked for me. Everytime I was getting "can not install due to dependency failure" errror. Your solution worked. – A N May 05 '15 at 13:25
  • 1
    Thanks so much, me too i tried all other solutions, but none of them worked for me. I followed your steps with Neon instead of Indigo, and it worked :) – Ahmed Laatabi Nov 16 '16 at 20:40
  • 1
    Thanks a lot @mukesh Kumar .........Neon users -- Simply use url - http://download.eclipse.org/releases/neon/ and in the filter type maven and install all the needed software for maven – Anurag_BEHS Aug 31 '17 at 21:18
13

First install maven in your system and set Maven environment variables

  1. M2_HOME: ....\apache-maven-3.0.5 \ maven installed path
  2. M2_Repo: D:\maven_repo \If change maven repo location
  3. M2: %M2_HOME%\bin

Steps to Configures maven on Eclipse IDE:

  • Select Window -> Preferences Note: If Maven option is not present, then add maven 3 to eclipse or install it.
  • Add the Maven location of your system

To check maven is configured properly:

  • Open Eclipse and click on Windows -> Preferences

  • Choose Maven from left panel, and select installations.

  • Click on Maven -> "User Settings" option form left panel, to check local repository location.

Anil Satija
  • 350
  • 3
  • 13
12

By "use install a Maven plugin and use it" I am sure you are looking for a Eclipse plugin that will perform Maven functions within the IDE. If so, M2E is a good choice. You will find a lot of help within the Eclipse installation once you install M2E.

That said -- considering that you are starting off using Maven -- it would go a long way to have a good understanding of the basic concepts. Using M2E could hide some of the details which could lead to incomplete or incorrect interpretation of Maven's behavior and therefore problems downstream.

Some good Maven online references are:

Sri Sankaran
  • 8,120
  • 4
  • 38
  • 47
  • 4
    But how do you install M2E on eclipse? (I actually need to install it to MuleStudio.. o.O) – david Jan 05 '12 at 17:46
  • I am not familiar with Mule Studio. If it is a plugin for Eclipse 3.7 (a.k.a. Indigo) you should be able to install M2E from the Eclipse Marketplace (Help > Eclipse Marketplace...: Search for "m2e" and select "Maven Integration for Eclipse"). Alternatively you can download it from the M2E web site (http://eclipse.org/m2e/) – Sri Sankaran Jan 05 '12 at 21:46
  • i have installed the plugin and i try to add some sources (artifact or something i think) and the plugin can't find where is installed, netheir i try to download from the plugin and can't find how do it... – Enrique San Martín May 15 '13 at 12:09
  • "You will find a lot of help within the Eclipse installation once you install M2E." - but where? There's nothing in the installed help (Help -> Help Contents). – Martin Schröder Feb 27 '15 at 14:01
  • @MartinSchröder I wrote that over 3 years ago and it was valid then. I am sorry but I haven't kept up with Eclipse since then. – Sri Sankaran Feb 27 '15 at 21:05
6

Check This

instead to avoid this error:

Cannot complete the install because one or more required items could not be found. Software being installed: m2e - slf4j over logback logging (Optional) 1.6.1.20150625-2338 (org.eclipse.m2e.logback.feature.feature.group 1.6.1.20150625-2338) Missing requirement: Maven Integration for Eclipse 1.6.0.20150526-2032 (org.eclipse.m2e.core 1.6.0.20150526-2032) requires 'bundle com.google.guava [14.0.1,16.0.0)' but it could not be found Missing requirement: Maven Integration for Eclipse 1.6.1.20150625-2338 (org.eclipse.m2e.core 1.6.1.20150625-2338) requires 'bundle org.eclipse.osgi 3.10.0' but it could not be found Cannot satisfy dependency: From: Maven Integration for Eclipse 1.6.0.20150526-2032 (org.eclipse.m2e.core.ui 1.6.0.20150526-2032) To: bundle org.eclipse.m2e.core [1.6.0,1.7.0) Cannot satisfy dependency: From: Maven Integration for Eclipse 1.6.1.20150625-2338 (org.eclipse.m2e.core.ui 1.6.1.20150625-2338) To: bundle org.eclipse.m2e.core [1.6.0,1.7.0) Cannot satisfy dependency: From: m2e logback appender 1.6.1.20150625-2338 (org.eclipse.m2e.logback.appender 1.6.1.20150625-2338) To: bundle org.eclipse.m2e.core.ui [1.6.0,1.7.0) Cannot satisfy dependency: From: m2e - slf4j over logback logging (Optional) 1.6.1.20150625-2338 (org.eclipse.m2e.logback.feature.feature.group 1.6.1.20150625-2338) To: org.eclipse.m2e.logback.appender [1.6.1.20150625-2338]

source

Community
  • 1
  • 1
Hojat Modaresi
  • 641
  • 7
  • 10
4

You have to follow the following steps in the Eclipse IDE

  1. Go to Help - > Install New Software
  2. Click add button at top right corner
  3. In the popup coming, type in name as "Maven" and location as "http://download.eclipse.org/technology/m2e/releases"
  4. Click on OK.

Maven integration for eclipse will be dowloaded and installed. Restart the workspace.

In the .m2 folder(usually under C:\user\ directory) add settings.xml. Give proper proxy and profiles. Now create a new Maven project in eclipse.

sunitha
  • 1,468
  • 14
  • 18
3

I have also come across the same issue and figuredout the issue here is the solution.

Lot of people assumes Eclipse and maven intergration is tough but its very eassy.

1) download the maven and unzip it in to your favorite directory.

Ex : C:\satyam\DEV_TOOLS\apache-maven-3.1.1

2) Set the environment variable for Maven(Hope every one knows where to go to set this)

In the system variable: Variable_name = M2_HOME Variable_Value =C:\satyam\DEV_TOOLS\apache-maven-3.1.1

Next in the same System Variable you will find the variable name called Path: just edit the path variable and add M2_HOME details like with the existing values.

%M2_HOME%/bin;

so in the second step now you are done setting the Maven stuff to your system.you need to cross check it whether your setting is correct or not, go to command prompt and type mvn--version it should disply the path of your Maven

3) Open the eclipse and go to Install new software and type M2E Plugin install and restart the Eclipse

with the above 3 steps you are done with Maven and Maven Plugin with eclipse

4) Maven is used .m2 folder to download all the jars, it will find in Ex: C:\Users\tempsakat.m2

under this folder one settings.xml file and one repository folder will be there

5) go to Windwo - preferences of your Eclipse and type Maven then select UserSettings from left menu then give the path of the settings.xml here .

now you are done...

katakam
  • 51
  • 6
3

Maven Eclipse plugin installation step by step:

Open Eclipse IDE Click Help -> Install New Software Click Add button at top right corner At pop up: fill up Name as you want and Location as http://download.eclipse.org/technology/m2e/milestones/1.0 Now click OK And follow the instruction

amoljdv06
  • 2,646
  • 1
  • 13
  • 18
2

I have just include Maven integration plug-in with Eclipse:

Just follow the bellow steps:

In eclipse, from upper menu item select- Help ->click on Install New Software..-> then click on Add button.

set the MavenAPI at name text box and http://download.eclipse.org/technology/m2e/releases at location text box.

press OK and select the Maven project and install by clicking next.

Ryan K
  • 3,985
  • 4
  • 39
  • 42
2

Tried every stuff but this one worked .. 1. Eclipse -> Help -> Install New Software. 2. Type " http://download.eclipse.org/releases/indigo/ " & Hit Enter. 3. Expand " Collaboration " tag. 4. Select Maven plugin from there. 5. Click on next . 6. Accept the agreement & click finish. After installing the maven it will ask for restarting the Eclipse, So restart the eclipse again to see the changes.

Thanks Mukesh for Guiding.

user1452911
  • 21
  • 1
  • 2
  • I liked this option as it will automatically List out the compatible m2e version for the eclipse we are using.Earlier I was trying to get the latest m2e plug-in for juno..but it was giving exception while installing – Shravan Ramamurthy Jun 07 '16 at 16:09
1

I was having problems because I was looking to install the Maven plugin on MuleStudio not Eclipse..

[for MuleStudio 1.2 or below do steps (1) and (2) otherwise jump to step (2)]

Instructions for MuleStudio (ONLY versions 1.2 and below): (1) Help >install new software...

Helios Update Site - http://download.eclipse.org/releases/helios/

Instructions for MuleStudio (1.3) OR Eclipse: (2) Help >install new software...

Maven -  URL: http://download.eclipse.org/technology/m2e/releases
david
  • 741
  • 3
  • 10
  • 29
0

The latest version of Eclipse (Luna) and Spring Tool Suite (STS) come pre-packaged with support for Maven, GIT and Java 8.

A. Rick
  • 649
  • 5
  • 11
0

I have just include Maven integration plug-in at Eclipse:

Just follow the bellow steps:

  • In eclipse, from upper menu item select- "Help" ->click on "Install New Software.."-> then click on "Add" button.

  • set the "MavenAPI" at name text box and "http://download.eclipse.org/technology/m2e/releases" at location text box.

  • press Ok and select the Maven project and install by clicking next next.

Syeful Islam
  • 3,785
  • 1
  • 20
  • 19