Install Maven Eclipse on Ubuntu and configure

Source: Internet
Author: User

download to the current MAVEN installation package via the official website http://maven.apache.org/download.cgi

Ubuntu Unzip the installation file
I'm using Ubuntu version 12.10.
command:
#: sudo tar zxvf apache-maven-3.0.5-bin.tar.gz
after extracting, get a folder
apache-maven-3.0.5
  
OK To do the above, then let's do the next step, add the Maven path path
#: sudo vi etc profile
Edit
add at the back of the file
Export maven_home=/usr/local/apache-maven-3.0.5
export path= $PATH: $MAVEN _home/bin

Save Exit Edit

then enter the command:
#: Echo $MAVEN _home
You can view the path of the current installation package, "NULL" indicates that no configuration was successful
#:mvn-version can see the current MAVEN version number
-----------------------------------------------------------The above results are successful, The installation succeeds---------------------------------------------------

installing maven under Eclipse
Start Eclipse
choose Eclipse to put help-> insertnewsoftware-> work witch right click on Add
name:m2e
location:http://m2eclipse.sonatype.org/sites/m2e

If the network is good, you may download it in a moment .
then in the text field below, tick always next to OK

All that is left is the next---next---next->, Finish--------------------------------------------------------------------------------------------------------------- -------------------the second kind-------------------------------------------------------------------------------------------------

When using Ubuntu, you want to use your own download of maven, do not, find a bit on the internet, solve.

Ha, official online also has, but for Ubuntu not very understand: http://maven.apache.org/download.cgi

Original address: http://my.oschina.net/hongdengyan/blog/150472

----------------------------------------------------------------

Environment Description:

Operating system: Ubuntu 12.04.2 LTS

maven:apache-maven-3.1.0

Before installing MAVEN, please install JDK,JDK installation can see: http://my.oschina.net/hongdengyan/blog/150342.

1. Download maven

Download Link: http://maven.apache.org/download.cgi

Select the latest version of the MAVEN installation package that I installed when the latest installation package is apache-maven-3.1.0-bin.tar.gz.

The path mentioned in the article "/home/yan" is my native, need to replace your path.

The path to download the saved file is:/home/yan/download/, you need to replace the download path.

2. Decompression and Installation

[Email protected]:/$ cd/home/yan/Download

[Email protected]:/$ cd/home/yan/Download

Apache-maven-3.1.0-bin.tar.gz

[Email protected]:~/download $ tar-zxvf apache-maven-3.1.0-bin.tar.gz

[email protected]:~/download $ ls

apache-maven-3.1.0

[Email protected]:~/download $ sudo mv apache-maven-3.1.0/usr/local/

[Email protected]:~/Download $ ls/usr/local

apache-maven-3.1.0 bin Eclipse etc games include Java Lib man sbin share src

3. Setting Environment variables

Open and edit the profile file as root:

[Email protected]:/$ sudo gedit/etc/profile

At the end of the file add:

#set maven environmentm2_home=/usr/local/apache-maven-3.1.0export maven_opts= "-xms256m-xmx512m" Export PATH= $M 2_ Home/bin: $PATH

Save and close.

For the configuration to take effect, you must restart the machine or enter it at the command line:

[Email protected]:/$. /etc/profile[email protected]:/$ mvn-versionapache Maven 3.1.0 (893CA28A1DA9D5F51AC03827AF98BB730128F9F2; 2013-06-28 10:15:32+0800) Maven Home:/usr/local/apache-maven-3.1.0java version:1.7.0_25, Vendor:oracle CorporationJava home:/ Usr/local/java/jdk1.7.0_25/jredefault LOCALE:ZH_CN, platform Encoding:utf-8os name: "Linux", Version: "3.5.0-23- Generic ", Arch:" I386 ", Family:" Unix "

4. Configure User Scope Setting.xml

[Email protected]:/$ sudo cp/usr/local/apache-maven-3.1.0/conf/settings.xml/home/yan/.m2[email protected]:/$ sudo Gedit/home/yan/.m2/settings.xml

Found in file

 <!--  Localrepository |     The path to the local repository maven would use to store artifacts.     | | Default: ${user.home}/.m2/repository <localRepository>/path/to/local/repo</localRepository>  Span style= "color: #008000;" >-->  
<!-- Localrepository    | The path to the local repository maven would use to store artifacts.    Default: ${user.home}/.m2/repository   <localRepository>/path/to/local/repo</localRepository>     -    < localrepository >/home/yan/code/repository/maven</localrepository>  
Where:/home/yan/code/repository/maven is the path to your Maven local repository.

----------------------------------------

PostScript: Restart the system, run the command mvn--version is the version you downloaded, run the command

MVN Help:system   

This will download some basic things, very good. --------------------------------------------------------------------------------------------------------------- The third------------------------------------------------------------------------------------------------------------of---

1. Install maven: http://maven.apache.org/download.cgi download version 3.1.0

2. Unzip to the development path, select/usr/local/java/apache-maven-3.1.0 here.

3. Link to/usr/bin/mvn:ln-s/USR/LOCAL/JAVA/APACHE-MAVEN-3.1.0/BIN/MVN/USR/BIN/MVN

4. Modify the configuration file/etc/profile

Add the following as follows:

Export Java_home=/usr/local/java/jdk1.7.0_25export Jre_home=/usr/local/java/jdk1.7.0_25/jreexport MAVEN_HOME=/usr /local/java/apache-maven-3.1.0export classpath=.: $JAVA _home/lib: $JRE _home/lib: $CLASSPATHexport path= $JAVA _home/ Bin: $MAVEN _home/bin: $JRE _home/bin: $JAVA _home: $PATH

5. Executive Source/etc/profile;mvn-v

Install Maven Eclipse on Ubuntu and configure

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.