Ubuntu Install Maven

Source: Internet
Author: User

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

First, environmental description:

Operating system: Ubuntu 14.10 (64-bit)

maven:apache-maven-3.2.2

Install the JDK before you install MAVEN.

Second, 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.2.2-bin.tar.gz.

The path to download the saved file is: ~/download/.

Three, decompression installation?
1 ~$ cd~/下载

Extract:

?
1 ~/下载$ tar-zxvf apache-maven-3.2.2-bin.tar.gz
to move the apache-maven-3.2.2 directory to the/usr/local directory:?
1 ~/下载$ sudomvapache-maven-3.2.2/ /usr/local/
Iv. Setting Environment variables

Open and edit the profile file as root:

?
1 ~/下载$ sudogedit /etc/profile

At the end of the file add:

#set maven Environment
m2_home=/usr/local/apache-maven-3.2.2

Export 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:

?
1 ~/下载$ . /etc/profile
To see if MAVEN was installed successfully:?
1 ~/下载$ mvn -version

Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17t21:51:42+08:00)
Maven Home:/usr/local/apache-maven-3.2.2
Java version:1.7.0_60, Vendor:oracle Corporation
Java Home:/usr/local/java/jdk1.7.0_60/jre
Default LOCALE:ZH_CN, Platform Encoding:utf-8
OS name: "Linux", Version: "3.5.0-23-generic", Arch: "I386", Family: "Unix"

V. Configuring user Scope Setting.xml

?
1 ~/下载$ gedit /usr/local/apache-maven-3.2.2/conf/settings.xml 

Found in file

?
123456 <!-- localRepository   | The path to the local repository maven will use to store artifacts.   |   | Default: ${user.home}/.m2/repository  <localRepository>/path/to/local/repo</localRepository>-->
add content after:
?
12345678 <!--localrepository Code class= "XML Spaces" >&NBSP;&NBSP;&NBSP; | The path to the local repository maven would use to store artifacts. &NBSP;&NBSP;&NBSP; | &NBSP;&NBSP;&NBSP; | Default: ${user.home}/.m2/repository &NBSP;&NBSP; <LOCALREPOSITORY>/PATH/TO/LOCAL/REPO</LOCALREPOSITORY> &NBSP;&NBSP; -->    < localrepository >${user.home}/repository/maven</ localrepository >

Where: ${user.home}/repository/maven is the path to your Maven local repository.

Save exit.

Ubuntu install maven (GO)

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.