为了服务于jenkins,准备安装maven
首先在官网下载最新版本的maven,我此时的版本为apache-maven-3.3.9-bin.tar.gz
把该文件移到到/usr/local下
进行解压
tar xzvf apache-maven-3.3.9-bin.tar.gz
修改名称
mv apache-maven-3.3.9 maven
配置环境变量,打开 vim /etc/profile # 添加maven的bin目录和maven_home
然后使其配置生效
source /etc/profile
最后验证 mvn -v
出现如下信息,就证明已安装成功。
- Apache Maven 3.3.9 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T04:57:37-07:00)
- Maven home: /opt/apache-maven-3.3.3
- Java version: 1.8.0_45, vendor: Oracle Corporation
- Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre
- Default locale: en_US, platform encoding: UTF-8
- OS name: "mac os x", version: "10.8.5", arch: "x86_64", family: "mac"