linux下maven的安装
参照两篇博文http://fluagen.blog.51cto.com/146595/40086
http://blog.csdn.net/totogogo/archive/2007/12/18/1946691.aspx
1)下载maven-3.0.1:http://maven.apache.org/download.html,将其解压tar xzvf apache-maven-3.0.1.tar.gz,我的放在home/hadoop/下的。
2)设置环境变量,在etc/profile添加export MAVEN_HOME=/home/hadoop/apache-maven-3.0.1
export PATH=$MAVEN_HOME/bin:$PATH
3)在终端mvn -v查看maven版本信息,说明maven安装成功:
[hadoop@sc706-26 mahout-distribution-0.4]$ mvn -v
Apache Maven 3.0.1 (r1038046; 2010-11-23 05:58:32-0500)
Java version: 1.6.0_19
Java home: /usr/java/jdk1.6.0_19/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux" version: "2.6.32.12-115.fc12.i686.pae" arch: "i386" Family: "unix"
4) 因为得要在官网上下载一些包,我所用的网需要设置网络代理,在~/.m2/settings.xml里设置,如没有settings.xml,将 maven安装目录下/conf/settings.xml拷贝过去,找到网络代理设置,取消注释,进行设置,参考本文开头的博文及官网http://maven.apache.org/ref/3.0/maven-settings/settings.html :
<proxies>
<proxy>
<id>my-proxy</id>
<active>true</active>
<protocol>http</protocol>
<username>s09120100006</username>
<password>54321</password>
<host>210.31.112.8</host>
<port>8080</port>
<!-- <nonProxyHosts>local.net|some.host.com</nonProxyHosts> -->
</proxy>
</proxies>
更多推荐
所有评论(0)