当前位置:   article > 正文

Mac安装并配置maven_mvn -v apache maven 3.6.3 (cecedd343002696d0abb50b

mvn -v apache maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) maven h

资源

maven官网
https://maven.apache.org/
阿里maven
https://developer.aliyun.com/mvn/guide

下载

下载maven点击下载

指定文件目录 可选

在这里插入图片描述

在这里插入图片描述

镜像

Binary zip archive apache-maven-3.6.3-bin.zip

bennyrhysdeMacBook-Pro:.m2 bennyrhys$ vim ~/.bash_profile 
bennyrhysdeMacBook-Pro:.m2 bennyrhys$ source ~/.bash_profile 
bennyrhysdeMacBook-Pro:.m2 bennyrhys$ mvn -v
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /Users/bennyrhys/Documents/java_install/apache-maven-3.6.3
Java version: 1.8.0_121, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.6", arch: "x86_64", family: "mac"
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

source ~/.path配置文件,使编辑生效。在输入mvn -v

修改maven根目录下的conf文件夹中的setting.xml文件,内容如下:local可以不写

  <localRepository>/Users/shangri-la/.m2/repository</localRepository>
 <mirrors>
    <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>        
    </mirror>
  </mirrors>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

运行下载 初始化仓库

mvn help:system

还要配置

   <!--配置profiles节点-->
  <profiles>
  <profile>
            <id>jdk-1.8</id>
            <activation>
                <jdk>1.8</jdk>
            </activation>
            <repositories>
                <repository>
                    <id>nexus</id>
                    <name>local private nexus</name>
                    <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>nexus</id>
                    <name>local private nexus</name>
                    <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34

idea使用

在这里插入图片描述

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

闽ICP备14008679号