当前位置:   article > 正文

Maven的安装和配置

Maven的安装和配置

国内Maven仓库之阿里云Aliyun仓库地址及设置

用过Maven的都知道Maven的方便便捷,但由于某些网络原因,访问国外的Maven仓库不便捷,好在阿里云搭建了国内的maven仓库。
需要使用的话,要在maven的settings.xml 文件里配置mirrors的子节点,添加如下mirror:
在这里插入图片描述

<mirror>
    <id>nexus-aliyun</id>
    <mirrorOf>*</mirrorOf>
    <name>Nexus aliyun</name>
    <url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

在这里插入图片描述

Maven配置settings.xml指定默认java8版本

<mirrors>
    <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>        
    </mirror>
  </mirrors>
 
  <profiles>
         <profile>    
            <id>jdk8</id>    
            <activation>    
               <activeByDefault>true</activeByDefault>    
               <jdk>1.8</jdk>    
            </activation>    
            <properties>    
                    <maven.compiler.source>1.8</maven.compiler.source>    
                    <maven.compiler.target>1.8</maven.compiler.target>    
                    <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>    
                </properties>    
        </profile>
  </profiles>
 
  <activeProfiles>
        <activeProfile>jdk8</activeProfile>
  </activeProfiles>
  • 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
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/article/detail/40418
推荐阅读
相关标签
  

闽ICP备14008679号