配置Setting.xml文件提高maven更新下载jar包速度

Posted gavincoder

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了配置Setting.xml文件提高maven更新下载jar包速度相关的知识,希望对你有一定的参考价值。

<?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
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: $user.home/.m2/repository
  -->
  <localRepository>E:\maven\repository</localRepository>

    <mirrors>
     <!--配置国内maven镜像源-->
        <mirror>
            <id>alimaven-central</id>
            <mirrorOf>central</mirrorOf>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
            </mirror>
        <mirrors>  
            <mirror>  
                <id>alimaven</id>  
                <name>aliyun maven</name>  
                <url>http://maven.aliyun.com/nexus/content/groups/public/</url>  
                <mirrorOf>central</mirrorOf>  
            </mirror>  
        </mirrors>  
        <mirror>
            <id>jboss-public-repository-group</id>
            <mirrorOf>central</mirrorOf>
            <name>JBoss Public Repository Group</name>
            <url>http://repository.jboss.org/nexus/content/groups/public</url>
        </mirror>
    </mirrors>

    <profiles>  
        <profile>  
           <id>nexus</id>   
            <repositories>  
                <repository>  
                    <id>nexus</id>  
                    <name>local private nexus</name>  
                    <url>http://maven.oschina.net/content/groups/public/</url>  
                    <releases>  
                        <enabled>true</enabled>  
                    </releases>  
                    <snapshots>  
                        <enabled>false</enabled>  
                    </snapshots>  
                </repository>
                
                <repository>
                    <id>spring-snapshots</id>
                    <name>Spring Snapshots</name>
                    <url>https://repo.spring.io/snapshot</url>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
                <repository>
                    <id>spring-milestones</id>
                    <name>Spring Milestones</name>
                    <url>https://repo.spring.io/milestone</url>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </repository>                
            </repositories>           
            <pluginRepositories>  
                <pluginRepository>  
                <id>nexus</id>  
                <name>local private nexus</name>  
                <url>http://maven.oschina.net/content/groups/public/</url>  
                <releases>  
                    <enabled>true</enabled>  
                </releases>  
                <snapshots>  
                    <enabled>false</enabled>  
                </snapshots>  
                </pluginRepository>  
            </pluginRepositories>  
        </profile>
    </profiles>  

</settings>

 

以上是关于配置Setting.xml文件提高maven更新下载jar包速度的主要内容,如果未能解决你的问题,请参考以下文章

maven仓库

如何更改maven的setting文件目录

idea下修改maven的setting.xml配置阿里云镜像

maven有两个setting.xml配置文件,请问他们是如何被读取的? 分别啥时候被读取?

maven配置文件详解

坑爹的maven配置文件(.m2/setting.xml)