码迷,mamicode.com
首页 > 系统相关 > 详细

ubuntu 安装 maven3.2

时间:2014-12-29 22:56:53      阅读:542      评论:0      收藏:0      [点我收藏+]

标签:

1、下载并解压 apache-maven-3.2.5-bin.tar.gz

tar -xzvf apache-maven-3.2.5-bin.tar.gz

2、设置环境变量

sudo gedit ~/.profile

export M2_HOME=/opt/apache-maven-3.2.5
export M2=$M2_HOME/bin
export PATH=$M2:$PATH

3、查看maven配置

mvn -version

root@zsh-Aspire-4750:~# mvn -version
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-15T01:29:23+08:00)
Maven home: /opt/apache-maven-3.2.5
Java version: 1.8.0_25, vendor: Oracle Corporation
Java home: /opt/jvm/jdk1.8.0_25/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-24-generic", arch: "amd64", family: "unix"
root@zsh-Aspire-4750:~# 

4、修改settings.xml

修改maven仓库地址 sudo gedit settings.xml

  <!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ${user.home}/.m2/repository
  <localRepository>/path/to/local/repo</localRepository>
  -->
<localRepository>/opt/maven_jar</localRepository>

 

ubuntu 安装 maven3.2

标签:

原文地址:http://www.cnblogs.com/cbread/p/4192474.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!