maven-常用仓库配置

Maven提供了一个中央仓库,其地址为:http://repo.maven.apache.org/maven2 ,该仓库包含了绝大多数流行的开源Java构件,以及源码、作者信息、SCM、信息、许可证信息等。据统计,每个月中央仓库大概会接受全世界Java程序员大概1亿次访问,其重要性不言而喻。

 <repositories>  
        <repository>  
            <id>jboss</id>  
            <name>JBoss Repository</name>  
            <url>http://repository.jboss.com/maven2/</url>  
            <releases>  
                <updatePolicy>daily</updatePolicy><!-- never,always,interval n -->  
                <enabled>true</enabled>  
                <checksumPolicy>warn</checksumPolicy><!-- fail,ignore -->  
            </releases>  
            <snapshots>  
                <enabled>false</enabled>  
            </snapshots>  
            <layout>default</layout>  
        </repository>  
</repositories>


<mirror>
    <id>nexus-aliyun</id>
    <name>Nexus aliyun</name>
    <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
    <mirrorOf>central</mirrorOf>
</mirror>

<mirror>
    <id>repo2</id>
    <name>Mirror from Maven Repo2</name>
    <url>http://repo2.maven.org/maven2/</url>
    <mirrorOf>central</mirrorOf>
</mirror>

<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>

https://repo.spring.io/milestone
https://repo.spring.io/snapshot


	<mirror>
		<id>osc</id>
		<mirrorOf>oschina</mirrorOf>
		<url>http://maven.oschina.net/content/groups/public/</url>
	</mirror>
	<!-- spring的libs-release镜像,存放spring项目及其子项目的jar包,以及相关的依赖jar -->
	<mirror>
		<id>libs-release</id>
		<mirrorOf>repo1</mirrorOf>
		<url>https://repo.spring.io/libs-release</url>
	</mirror>
	
	<!-- spring的milestone镜像,存放着spring项目及其子项目的里程碑版本jar包 -->
	<mirror>
		<id>milestone</id>
		<mirrorOf>repo2</mirrorOf>
		<url>https://repo.spring.io/milestone</url>
	</mirror>
	
	<!-- spring的snapshot镜像,存放着spring项目及其子项目的预览版本jar包 -->
	<mirror>
		<id>snapshot</id>
		<mirrorOf>repo3</mirrorOf>
		<url>https://repo.spring.io/snapshot</url>
	</mirror>
	<!-- mvnrepository镜像,常用的maven中央仓库jar查询站点,可直接当maven镜像使用 -->
	<mirror>
		<id>mvn</id>
		<mirrorOf>mvnrepository</mirrorOf>
		<url>http://mvnrepository.com/</url>
	</mirror>
	<mirror>
    <id>huaweicloud</id>
    <mirrorOf>*</mirrorOf>
    <url>https://repo.huaweicloud.com/repository/maven/</url>
</mirror>

repositories {
		mavenCentral()
		if (!version.endsWith('RELEASE')) {
			maven { url "https://repo.spring.io/milestone" }
		}
		if (version.endsWith('BUILD-SNAPSHOT')) {
			maven { url "https://repo.spring.io/snapshot" }
		}
	}

<?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">
  <pluginGroups>
  </pluginGroups>
  <proxies>
  </proxies>

  <servers>
    <server>
      <id>nexus</id>
      <username>indeed</username>
      <password>indeed</password>
    </server>
  </servers>

  <mirrors>
    <!--对Maven的默认仓库central镜像-->
    <mirror>
      <id>nexus</id>
      <mirrorOf>central</mirrorOf>
      <url>http://192.168.1.17:8081/repository/maven-public/</url>
    </mirror>

    <!--对Spring的maven仓库spring-milestones镜像-->
    <mirror>
      <id>spring</id>
      <mirrorOf>spring-milestones</mirrorOf>
      <url>http://192.168.1.17:8081/repository/spring-milestones/</url>
    </mirror>
  </mirrors>

  <profiles>
    <profile>
      <id>nexus</id>
      <repositories>
        <repository>
          <id>central</id>
          <url>http://central</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>http://central</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>

    <profile>
      <id>spring</id>
      <repositories>
        <repository>
          <id>spring-milestones</id>
          <url>https://spring</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>spring-milestones</id>
          <url>https://spring</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>

  <activeProfiles>
    <activeProfile>spring</activeProfile>
    <activeProfile>nexus</activeProfile>
  </activeProfiles>
</settings>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

猿与禅

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值