首先安装java1.8 这个gaoding
其次下载mvn
http://maven.apache.org/
解压缩
tar -vxzf apache-maven-3.3.9-bin.tar.gz -C /usr/local/
设置环境变量
export MVN_HOME=/usr/local/apache-maven-3.3.9
export PATH=${MVN_HOME}/bin:$PATH
source /etc/profile
查看结果
root@ubuntu:/usr/local/java/jdk1.8.0_121# mvn -v
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: /usr/local/apache-maven-3.3.9
Java version: 1.8.0_121, vendor: Oracle Corporation
Java home: /usr/local/java/jdk1.8.0_121/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-108-generic", arch: "amd64", family: "unix"
设置本地仓储库
vim /usr/local/apache-maven-3.3.9/conf/settings.xml
<profile>
<id>profile-nexus</id>
<repositories>
<repository>
<id>nexus</id>
<url>http://10.142.164.239/nexus/content/groups/public/</url>
<snapshots><enabled>true</enabled></snapshots>
<releases><enabled>true</enabled></releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<url>http://10.142.164.239/nexus/content/groups/public/</url>
<snapshots><enabled>true</enabled></snapshots>
<releases><enabled>true</enabled></releases>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>