国外的镜像下载太慢了,我亲测下了一个小时没下好。。。
QQ截图20191216151945.png

Build,Execution,Deployment -> Maven

我们不用官方提供的,我们用自己本机的maven;

红色圈的 分别是 Maven 目录 ,用户settings设置 以及本地仓库地址; 我们都选择设置下;

这里的settings,我们要设置下maven阿里云镜像
我本地的路径就是C:Usersadmin.m2settings.xml
我们打开这个路径
QQ截图20191216152219.png

这里我直接把我的代码发出来好了 直接覆盖即可

<?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: ~/.m2/repository -->
  <localRepository>C:\Users\admin\.m2\repository</localRepository>
 

  <pluginGroups>

  </pluginGroups>


  <proxies>

  </proxies>


  <servers>
    
  </servers>

  <mirrors>
 
  </mirrors>
  
  <profiles>
    <profile>
        <id>aliyun_nexus</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <repositories>
        <repository>
            <id>public</id>
            <name>public</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
            <releases><enabled>true</enabled><updatePolicy>always</updatePolicy></releases> 
             <snapshots><enabled>true</enabled><updatePolicy>always</updatePolicy></snapshots> 
        </repository>

        <repository>
            <id>central</id>
            <name>central</name>
            <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
            <snapshots>
                <updatePolicy>interval:30</updatePolicy>
            </snapshots>
        </repository>
        
        <repository>
            <id>apache-snapshots</id>
            <name>apache-snapshots</name>
            <url>http://maven.aliyun.com/nexus/content/repositories/apache-snapshots/</url>
            <snapshots>
                <updatePolicy>interval:30</updatePolicy>
            </snapshots>
        </repository>
        
                <repository>
            <id>central-m1</id>
            <name>central-m1</name>
            <url>http://maven.aliyun.com/nexus/content/shadows/central-m1/</url>
            <snapshots>
                <updatePolicy>interval:30</updatePolicy>
            </snapshots>
        </repository>
        <repository>
            <id>codehaus-snapshots</id>
            <name>codehaus-snapshots</name>
            <url>http://maven.aliyun.com/nexus/content/repositories/codehaus-snapshots/</url>
            <snapshots>
                <updatePolicy>interval:30</updatePolicy>
            </snapshots>
        </repository>
        <repository>
            <id>releases</id>
            <name>releases</name>
            <url>http://maven.aliyun.com/nexus/content/repositories/releases/</url>
            <snapshots>
                <updatePolicy>interval:30</updatePolicy>
            </snapshots>
        </repository>
        
        <repository>
            <id>snapshots</id>
            <name>snapshots</name>
            <url>http://maven.aliyun.com/nexus/content/repositories/snapshots/</url>
            <snapshots>
                <updatePolicy>interval:30</updatePolicy>
            </snapshots>
        </repository>
        </repositories>
    </profile>
  </profiles>
  
  <activeProfiles>
      <activeProfile>aliyun_nexus</activeProfile>
  </activeProfiles>

</settings>
Last modification:December 16th, 2019 at 03:23 pm
如果觉得我的文章对你有用,请随意赞赏