Social Icons

twitterfacebookgoogle pluslinkedinrss feed Online Resume

Thursday, January 21, 2010

Installing Apache Maven and Configuring Eclipse with Maven


Installing Maven into your PC - Windows

Download Maven from here.MavenDownload
Unzip the file and put into Program files. So the Maven path would be C:\Program Files\apache-maven-2.2.1

Setting the Maven Environment Varable


Right click My Computer
Go to advanced tab
Click “Environment Variables” button
In the System variables click new button. Set the path to Maven directory and give M2_HOME as variable name as follows.

Click ok.
Now from the System Variable set select “Path” variable and click edit.
Add the ;% M2_HOME%/bin; at the end of path value as follows.

Click ok.
Verify the Installation
Open command line and type mvn command.

 

Installing Maven into your PC - Ubuntu

Unzip maven archive in to what ever location and set the path using one of below option.

Using Command permanent:

sudo ln -s /your/maven/location/bin/mvn /usr/bin/mvn

Option Two Temporary:

export M2_HOME=/your/maven/location/
export M2=%M2_HOME%\bin

Eclipse-Maven Configuration


Note that for Eclipse Update for Maven does not require Apache Maven to be installed to your PC.
--> 
First download eclipse 3.4.0 from here Latest Eclipse Download
-->

Then after the Eclipse installation update the Eclipse for m2Eclipse plug-in. Then you can work with maven inside Eclipse IDE.
-->
  • Run Eclipse
  • Go to Help
  • Software Updates


  •   Click Add Sites and in the opening window give the following URL. 

                                      http://m2eclipse.sonatype.org/update/
http://download.eclipse.org/technology/m2e/releases

  • Click Ok
  • Then Select Maven Integration for Eclipse Update Site from the site list and click install 

 

-->
After the successful update the eclipse will be asked for restart. Restart it. Now you can ensure the maven update by opening maven console.
-->
  • Go to Window icon from the menu bar
  • Select Show view
  • Select Console
-->

Eclipse console will be opened. In the console click “Open Console menu”. There you can see maven console selection. Select it. Console will change to maven console.


Post a Comment