首页 > 其他分享 >maven 配置先拉取私服仓库再拉取阿里云

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

时间:2023-02-01 23:33:57浏览次数:61  
标签:http 先拉取 私服 maven aliyun true public

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>

标签:http,先拉取,私服,maven,aliyun,true,public
From: https://www.cnblogs.com/kikyoqiang/p/17084501.html

相关文章

  • Idea Maven 建本地仓库-导入本地JAR包
    需求IDEA很方便集成了Maven,但是也有相应的问题,比如使用Maven仓没有包的时候不太方便,这时我们需要建立自已的本地仓库来实现实现找到Idea的安装目录下面的Maven......
  • Spring Native打包本地镜像,无需通过Graal的maven插件buildtools
    简介在文章《GraalVM和SpringNative尝鲜,一步步让Springboot启动飞起来,66ms完成启动》中,我们介绍了如何使用SpringNative和buildtools插件,打包出本地镜像,也打包成Docker......
  • maven的依赖管理dependencyManagement标签
    依赖管理(dependencyManagement)此标签仅针对依赖管理,但是实际不引入,避免子项目中引入过多 maven提供的dependencyManagement元素既能让子项目继承到父项目的依赖配置,......
  • Maven项目编译级别
    方式一:pom.xml文件中配置属性: <properties><maven.compiler.source>1.8</maven.compiler.source>       <maven.compiler.target>1.8</maven.compiler.target......
  • 今日工作心得之maven
    从gitlab上把项目拉下来之后,到idea里面用maven编译了下,结果就是提示有一些jar包下载不下来。根据提示,我去到自己的mavensetting.xml文件看了自己的mirror。然后得知这是......
  • Maven统一依赖版本管理
    对同一个项目组jar包最好使用相同的版本,为了方便升级框架,可以将jar包的版本信息统一提取出来统一声明版本号<properties><jgs.spring.version>4.3.20.RELEASE</s<jgs.sp......
  • Maven依赖调解
    实际开发中可能存在这种情况,A->B->C->X(1.0),A->D->X(2.0),此时X出现了2个版本1.0和2.0,此时A项目会选择X的哪个版本?解决这种问题,maven有2个原则:路径最近原则上面A->B->C->......
  • 关于Maven-常用依赖
    1.使用parent父类引用,解决依赖版本号不确定时自动匹配的问题<parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</arti......
  • Maven的依赖管理
    pom.xml文件中配置依赖关系:<?xmlversion="1.0"encoding="UTF-8"?><projectxmlns="http://maven.apache.org/POM/4.0.0"         xmlns:xsi="http://www.w3......
  • maven的setting.xml核心文件
    settings.xml,这个文件默认在MAVEN_HOME/conf目录,一般我们会拷贝一份放在~/.m2目录中;MAVEN_HOME/conf/settings.xml是全局范围的配置文件,整个机器上所有用户都会受到该配置......