1. 下载maven
maven下载地址:http://maven.apache.org/download.cgi
我下载的是:apache-maven-3.1.0-bin.tar.gz
2. 移动自己的存放目录
bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/下载$ mv apache-maven-3.1.0-bin.tar.gz /home/bixiaopeng/soft/jars
bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/下载$ cd /home/bixiaopeng/soft/jars
3. 解压
bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/soft/jars$ tar -zxvf apache-maven-3.1.0-bin.tar.gz
#查看解压后的结果
bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/soft/jars$ ls -al apache-maven-3.1.0/
总用量 44
drwxrwxr-x 6 bixiaopeng bixiaopeng 4096 8月 21 14:29 .
drwxrwxr-x 3 bixiaopeng bixiaopeng 4096 8月 21 14:29 ..
drwxrwxr-x 2 bixiaopeng bixiaopeng 4096 8月 21 14:29 bin
drwxrwxr-x 2 bixiaopeng bixiaopeng 4096 8月 21 14:29 boot
drwxr-xr-x 3 bixiaopeng bixiaopeng 4096 6月 28 10:12 conf
drwxr-xr-x 3 bixiaopeng bixiaopeng 4096 6月 28 10:12 lib
-rw-r--r-- 1 bixiaopeng bixiaopeng 11358 6月 28 10:12 LICENSE.txt
-rw-r--r-- 1 bixiaopeng bixiaopeng 1112 6月 28 10:12 NOTICE.txt
-rw-r--r-- 1 bixiaopeng bixiaopeng 2513 6月 28 10:12 README.txt
4. 配置maven环境变量
vim ~/.bashrc
#添加在文件底部
export MAVEN_HOME=/home/bixiaopeng/soft/jars/apache-maven-3.1.0export PATH=${MAVEN_HOME}/bin:$PATH
5. 修攺完成后使其立即生效
bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/soft/jars$ source ~/.bashrc
6. 查看一下版本
bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/soft/jars$ cd ~
bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~$ mvn -v
Apache Maven 3.1.0 (893ca28a1da9d5f51ac03827af98bb730128f9f2; 2013-06-28 10:15:32+0800)
Maven home: /home/bixiaopeng/soft/jars/apache-maven-3.1.0
Java version: 1.6.0_45, vendor: Sun Microsystems Inc.
Java home: /home/bixiaopeng/soft/jvm/jdk/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "3.8.0-27-generic", arch: "amd64", family: "unix"
订阅
微信搜索“毕小烦”或者扫描下面的二维码,即可订阅我的文章。
如果文章对你有帮助,请随手点个赞吧!
(完)