Mac下配置maven
idea中自带的maven clean和maven install有时候老是有红线提示,还是习惯在terminal终端下用命令快,比如clean install一个项目跳过测试,直接命令 mvn clean install -Dmaven.test.skip=true
1、用touch命令创建.bash_profile文件
touch .bash_profile
2、编辑文件,编辑完成后保存退出(:wq)
MAVEN_HOME=/Users/sunzhenzhou/softWare/apache-maven-3.5.0
PATH=$PATH:$MAVEN_HOME/bin
export MAVEN_HOME
export PATH
3、执行source命令使配置文件生效
source .bash_profile
4、mvn -v 查看
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T03:39:06+08:00)
Maven home: /Users/sunzhenzhou/softWare/apache-maven-3.5.0
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.4", arch: "x86_64", family: "mac"