maven 配置先拉取私服仓库再拉取阿里云

1、参考

Maven中阿里云私服配置
设置maven阿里云镜像和公司私服并存
maven-settings.zip下载

<?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>D:/Program/Java/MavenRepository</localRepository>

  <servers>
	<server>
      <id>allyworld</id>
      <username>账户1</username>
      <password>密码</password>
    </server>
	<server>
		<id>rdc-releases</id>
		<username>账户2</username>
		<password>密码</password>
	</server>
	<server>
		<id>rdc-snapshots</id>
		<username>账户3</username>
		<password>密码]qol</password>
	</server>
  </servers>

  <mirrors>
	<mirror>
		<id>aliyun</id>
		<mirrorOf>central</mirrorOf>
		<name>阿里云公共仓库</name>
		<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
	</mirror>
  </mirrors>
  
  <profiles>
	<profile>
	<!-- 定义profile注意下面激活的时候使用-->
	 <id>allyworldProfile</id>
      <repositories>
        <repository>
          <id>aliyun</id>
          <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
        <repository>
          <id>allyworld</id>
          <url>http://私服域名:8200/repository/maven-public/</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
     <pluginRepositories>
        <pluginRepository>
          <id>aliyun</id>
          <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </pluginRepository>
        <pluginRepository>
          <id>allyworld</id>
          <url>http://私服域名:8200/repository/maven-public/</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>

    <activeProfiles>
    	<!-- 定义profile注意下面激活的时候使用-->
       <activeProfile>allyworldProfile</activeProfile>
	</activeProfiles>

</settings>

posted @ 2023-02-01 23:29  一只桔子2233  阅读(852)  评论(0编辑  收藏  举报