当前位置:   article > 正文

Mac Maven安装和配置_maven mac安装与配置

maven mac安装与配置

目录

1、下载

2、环境配置

3、加载生效

4、IDEA配置


1、下载

Maven – Download Apache Maven

  1. 在指定目录解压
  2. % tar -zxf apache-maven-3.9.2-bin.tar.gz

2、环境配置

  • 2.1 环境配置
  1. % cat .bash_profile
  2. #JAVA
  3. #JAVA_HOME=我的jdk路径
  4. JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_361.jdk/Contents/Home
  5. PATH=$JAVA_HOME/bin:$PATH:.
  6. CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.
  7. export JAVA_HOME
  8. export PATH
  9. export CLASSPATH
  10. #maven
  11. export MAVEN_HOME=/Users/liuzhen02/DevelopEnvironment/apache-maven-3.9.2
  12. export PATH=${MAVEN_HOME}/bin:$PATH:.
  • 2.2 自定义本地库
 <localRepository>/Users/liuzhen02/DevelopEnvironment/repository</localRepository>
  • 2.3 配置阿里云镜像
  1. 【配置阿里云镜像信息】
  2. <mirror>
  3. <id>alimaven</id>
  4. <name>aliyun maven</name>
  5. <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
  6. <mirrorOf>central</mirrorOf>
  7. </mirror>

3、加载生效

% source .bash_profile
  1. % mvn -v
  2. Apache Maven 3.9.2 (c9616018c7a021c1c39be70fb2843d6f5f9b8a1c)
  3. Maven home: /Users/**/DevelopEnvironment/apache-maven-3.9.2
  4. Java version: 1.8.0_361, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_361.jdk/Contents/Home/jre
  5. Default locale: zh_CN, platform encoding: UTF-8
  6. OS name: "mac os x", version: "12.2.1", arch: "x86_64", family: "mac"

4、IDEA配置

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/588562
推荐阅读
相关标签
  

闽ICP备14008679号