美文网首页
Maven配置阿里云仓库镜像加快依赖下载速度

Maven配置阿里云仓库镜像加快依赖下载速度

作者: 年少懵懂丶流年梦 | 来源:发表于2017-06-12 17:18 被阅读996次

在 setting.xml 中加入以下配置:

<!-- 阿里镜像 -->
<mirror>
    <!--This sends everything else to /public -->
    <id>aliyun</id>
    <mirrorOf>central</mirrorOf> 
    <name>aliyun maven</name>
    <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror>

如果你不想进行全局配置,你也可以在你的项目中单独设置资源库,在 pom.xml 中加入以下配置:

<repositories>
    <repository>
        <id>aliyunmaven</id>
        <url>http://maven.aliyun.com/nexus/content/groups/public/</url>                 
    </repository>
</repositories>

完整 settings.xml 配置

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  
    <!--
        <localRepository>~/.m2</localRepository>
    -->

    <pluginGroups>
       
    </pluginGroups>

     <proxies>
        
    </proxies>

    <servers>
      
    </servers>
    <!--
        <mirrorOf>central</mirrorOf> 这里最好不要写成*号,否则你项目中的pom中配置repository不生效
    -->
    <mirrors>
        <mirror>
            <id>nexus-aliyun</id>
            <mirrorOf>central</mirrorOf>
            <name>Nexus Aliyun</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
        </mirror>
    </mirrors>

    <profiles>
        <profile>
            <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>true</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>
</settings>

相关文章

  • Maven配置阿里云仓库镜像加快依赖下载速度

    在 setting.xml 中加入以下配置: 如果你不想进行全局配置,你也可以在你的项目中单独设置资源库,在 po...

  • maven仓库镜像

    阿里云仓库镜像 gradle 配置 阿里云 代理了很多公共的maven仓库 网易云仓库镜像gradle配置

  • 使用阿里云Maven仓库镜像加快依赖下载速度

    对于国内的Maven使用者来说,官方中央仓库由于服务器在国外,导致依赖下载的速度相对比较缓慢。为了解决这一问题,可...

  • 阿里云 Maven 仓库配置

    maven 默认中央仓库速度太慢,可以修改 settings.xml 文件,配置阿里云镜像地址:

  • Mac OS Maven设置阿里云镜像仓库

    背景 Maven默认的链接下载镜像很慢,使用阿里云的镜像可以提升下载速度! 一、到Maven官网下载,并且配置环境...

  • 配置阿里云maven仓库

    官方的maven中央仓库在国内太慢了,速度不忍直视。好在国内有一些镜像仓库,比如阿里云,速度快很多很多。 配置阿里...

  • 那些年踩过的maven坑

    maven依赖 下载缓慢原因:maven中央仓库在国外, 下载慢解决: 配置国内仓库,作为中央仓库的镜像修改位置:...

  • 二、maven的配置

    修改Maven的配置信息 maven默认的中央仓库在国外,下载依赖包的速度会很慢,需要修改成国内的镜像仓库,国内仓...

  • 无法导入谷歌的com.googlecode.soundlibs.

    错误原因,maven配置文件的镜像不对。 正确的: <...

  • JavaWeb之Maven

    五、Maven 目录:Maven项目架构管理工具、下载安装Maven、配置环境变量、阿里云镜像、本地仓库、在IDE...

网友评论

      本文标题:Maven配置阿里云仓库镜像加快依赖下载速度

      本文链接:https://www.haomeiwen.com/subject/qkolqxtx.html