Operating System: Linuxx64/Ubuntu14.04ApacheMaven version: 3.3.9 it is recommended to set up a Java Development Environment in advance. For details, refer to the previous article titled setting up a Java Development Environment in UbuntuLinux system.
Operating System: Linux x64/Ubuntu 14.04
Apache Maven version: 3.3.9
It is recommended to build a Java Development Environment in advance: see the previous Ubuntu Linux system Java development environment to build http://www.linuxidc.com/Linux/2015-12/126928.htm
1. Go to the Apache Maven official website to download the latest version: Latest.
2. Create a folder in the appropriate path to store Maven. In this example, create an MVN sub-folder under the/opt directory. The operations are as follows:
Open Terminal (the last is T1) and enter:
Cd/opt # Go to the opt directory
Sudo mkdir mvn # create an mvn folder
Ls # the newly created mvn folder is displayed.
Cd mvn # enter the mvn folder
3. Copy the downloaded MVN package to the mvn directory. The operations are as follows:
Create another Terminal window (T2) and enter:
Cd Downloads # enter the Downloads folder
Ls # display the MVN file just downloaded,
Sudo cp apache-maven-3.3.9-bin.tar.gz/opt/mvn # copy the file to the newly created mvn folder (here Replace the "<>" section with your own MVN file name, which is later the same)
Sudo rm apache-maven-3.3.9-bin.tar.gz # Delete the installation package in the local directory (optional)
4. decompress and install MVN to configure environment variables. The operations are as follows:
Return to the first Terminal (T1) and enter:
Ls # display the copied MVN installation package
Sudo tar-zxvf apache-maven-3.3.9-bin.tar.gz # unzip the installation package
Ls # display the decompressed MVN folder and the original installation package
Sudo rm apache-maven-3.3.9-bin.tar.gz # delete original installation package
Sudo gedit/etc/profile # Open the profile file under the etc directory
5. configure global environment variables. The operations are as follows:
Add the MVN installation path at the end of the open profile document (confirm carefully ):
# Set maven environment
Export M2_HOME =/opt/mvn/apache-maven-3.3.9
Export MAVEN_OPTS = "-Xmx1024m" # Avoid memory overflow errors (optional)
Export PATH =$ {M2_HOME}/bin: $ {PATH}
6. Save and close the document. (Note: You can also run the vim command to edit etc/profile, open the command: sudo vim/etc/profile, and press Key to enter the editing mode, Key to exit the editing mode, and then press ":" and then enter "wq! "Save and exit; enter" q! "Do not save and Exit)
7. Enable configuration and verify. In Terminal, enter:
Mvn-v
8. The display effect is similar to the following:
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09425c07478323dc5; 2015-11-10T08: 41: 47-08:00)
Maven home:/opt/developTools/jjvm/apache-maven-3.3.9
Java version: 1.8.0 _ 65, vendor: Oracle Corporation
Java home:/opt/developTools/jvm/jdk1.8.0 _ 65/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.19.0-25-generic", arch: "amd64", family: "unix"
Maven authoritative guide _ Chinese full clear PDF http://www.linuxidc.com/Linux/2014-06/103690.htm
Maven 3.1.0 release, http://www.linuxidc.com/Linux/2013-07/87403.htm of Project Build tools
Install Maven http://www.linuxidc.com/Linux/2013-05/84489.htm in Linux
Maven3.0 configuration and simple use http://www.linuxidc.com/Linux/2013-04/82939.htm
Build sun-jdk and Maven2 http://www.linuxidc.com/Linux/2012-12/76531.htm in Ubuntu
Maven getting started http://www.linuxidc.com/Linux/2012-11/74354.htm
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2
This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-12/126929.htm