0
点赞
收藏
分享

微信扫一扫

maven 配置下载jar、源码等先走私服,找不到再走阿里云镜像

冬冬_79d4 2022-04-15 阅读 73
maven

maven 配置下载jar、源码等先走私服,找不到再走阿里云镜像

<?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">
  <localRepository>C:/repository</localRepository>

  <servers>
    <!-- 私服用户名密码 注意id与下面 profile.repository.id 对应 -->
    <server>
      <id>lakernexus</id>
      <username>laker</username>
      <password>laker123</password>
    </server>
  </servers>
  
  <mirrors>	 
	<mirror>
		<id>aliyunmaven</id>
		<mirrorOf>central</mirrorOf> <!-- 只代理central中央仓库镜像-->
		<name>阿里云公共仓库</name>
		<url>https://maven.aliyun.com/repository/public</url>
	</mirror>
  </mirrors>

  <profiles>
	<profile>
	<!-- 定义profile注意下面激活的时候使用-->
	 <id>lakerProfile</id>
      <repositories>
        <repository>
        	<!-- server.id对应-->
          <id>lakernexus</id>
          <url>https://lakernexus.com/repository/public/</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
     <pluginRepositories>
        <pluginRepository>
          <id>lakernexus</id>
          <url>https://lakernexus.com/repository/public/</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>

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

相关推荐

0 条评论