• maven地址配置为阿里maven仓库,附ali maven官方指南链接


     一、参考链接

    官方指南

    链接地址:https://help.aliyun.com/document_detail/102512.html?spm=a2c40.aliyun_maven_repo.0.0.36183054BpUElw

    或者:https://maven.aliyun.com/mvn/guide

    官方指南配置:

    <mirror>
        <id>aliyunmaven</id>
        <mirrorOf>*</mirrorOf>
        <name>阿里云公共仓库</name>
        <url>https://maven.aliyun.com/repository/public</url>
    </mirror>

     二、参考配置 

    1.设置本地仓库路径

      <!-- localRepository
       | The path to the local repository maven will use to store artifacts.
       |
       | Default: ${user.home}/.m2/repository
      <localRepository>/path/to/local/repo</localRepository>
      -->
      
      <localRepository>D:dvpt_envmvn-repo</localRepository>

    2.mirros节点中加入mirro子节点

    public仓库为central仓和jcenter仓的聚合仓

    <mirror>
        <id>aliyunmaven</id>
        <mirrorOf>*</mirrorOf>
        <name>阿里云公共仓库</name>
        <url>https://maven.aliyun.com/repository/public</url>
    </mirror> 

    @deprecate

    <mirror>
                <id>nexus-aliyun</id>
                <mirrorOf>central</mirrorOf>
                <name>Nexus aliyun</name>
                <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
        </mirror>

    3.profiles节点中加入profile子节点

    非必要配置。

    <profile>
        <id>jdk-1.8</id>
        <activation>
            <jdk>1.8</jdk>
        </activation>
        <repositories>
            <!-- public是central仓和jcenter仓的聚合仓。已配置在mirror节点 -->
            <!-- 
            <repository>
                <id>public</id>
                <url>https://maven.aliyun.com/repository/public</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
             -->
            <!-- 添加spring代理仓 -->
            <repository>
                <id>spring</id>
                <url>https://maven.aliyun.com/repository/spring</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </repository>
        </repositories>
    </profile>

     .

  • 相关阅读:
    ajax优缺点及用法
    通俗易懂:窗口函数 | 全是案例
    mysql基本数据类型
    Elasticsearch从入门到专家
    shell数组实和变量扩展实现keyvalue设计
    catboost学习笔记
    pacman总结
    常用archlinux软件索引
    Linux配置打印机
    记录一次实战GetShell
  • 原文地址:https://www.cnblogs.com/foolash/p/11747792.html
Copyright © 2020-2023  润新知