Configure maven to use the Alibaba cloud warehouse first, and then use the company's intranet warehouse

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


  <mirrors>
	<mirror>
      <id>aliyun-public</id>
      <mirrorOf>central</mirrorOf>
      <name>aliyun nexus</name>
      <url>https://maven.aliyun.com/repository/public/</url>
     </mirror>
  </mirrors>

  <profiles>
	 <!-- 配置远程局域网仓库 -->
     <profile>
      <id>nexus-company</id>
      <repositories>

        <repository>
          <id>central</id><!-- 阿里远程仓库 -->
          <url>https://maven.aliyun.com/repository/public/</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>

        <repository>
          <id>spring</id><!-- 阿里远程仓库 -->
          <url>https://maven.aliyun.com/repository/spring</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>

        <repository>
          <id>nexus-company</id>
		  <mirrorOf>*</mirrorOf>
		  <name>Human Readable Name for this Mirror.</name>
		  <url>http://10.1.10.10:8081/repository/maven-public/</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
        
      </repositories>

    </profile>
	
  </profiles>

  <activeProfiles>
      <activeProfile>nexus-company</activeProfile>
  </activeProfiles>
</settings>

Guess you like

Origin blog.csdn.net/weixin_45623983/article/details/126602941