kubesphere-devops环境-修改maven源到阿里云

文章目录


前言

使用kubesphere搭建了devops环境,但是在构建maven的时候,发现使用的是官方的镜像,修改为阿里云的mirrors


一、maven配置文件在kubesphere中的位置

地址:http://IP:PORT/clusters/default/projects/kubesphere-devops-worker/configmaps/ks-devops-agent

二、修改configmap,增加阿里源信息

增加之后,保存configmap

xml 复制代码
  <!-- mirrors
   | This is a list of mirrors to be used in downloading artifacts from remote repositories.
   |
   | It works like this: a POM may declare a repository to use in resolving certain artifacts.
   | However, this repository may have problems with heavy traffic at times, so people have mirrored
   | it to several places.
   |
   | That repository definition will have a unique id, so we can create a mirror reference for that
   | repository, to be used as an alternate download site. The mirror site will be the preferred
   | server for that repository.
   |-->
<mirrors>
    <!--  这里设置的是阿里公共代理仓库  -->
    <mirror>
        <!-- 镜像的唯一标识符,用来区分不同的镜像  -->
        <id>aliyunmaven</id>
        <!-- 镜像名称  -->
        <name>阿里云公共仓库</name>
        <!-- 镜像的URL地址 -->
        <url>https://maven.aliyun.com/repository/public</url>
        <!--   设置被代理的maven远程仓库ID,*表示匹配所有请求,即所有发送到远程仓库的请求都会被拦截,   
               并将请求重定向到<url>标签设置的代理仓库地址
               如果同时设置了多个代理镜像,精确匹配优先级>通配符匹配
               如果为同一个仓库设置了多个代理镜像,则默认会选择第一个(即写在最前面的镜像)
        -->
        <mirrorOf>*</mirrorOf>
    </mirror>
</mirrors>

总结

由于使用的是kubesphere的devops,所以还是要按照kubesphere的方式来修改。

相关推荐
码农小卡拉6 小时前
Maven与Gradle选型指南:如何匹配项目的依赖管理需求
java·gradle·maven
网络工程师_ling10 小时前
【阿里云多地域混合云网络架构】
网络·阿里云·架构
JavaGuide11 小时前
Maven 4 终于快来了,新特性很香!
后端·maven
咕噜企业分发小米14 小时前
阿里云与华为云基因测序数据分析中如何优化成本?
阿里云·华为云·云计算
一路向北North14 小时前
阿里云maven仓库拉取依赖提示Connection reset
阿里云·云计算·maven
Mr.朱鹏15 小时前
Spring Boot 配置文件加载顺序与优先级详解
java·spring boot·后端·spring·maven·配置文件·yml
m0_5791466515 小时前
Maven 编译的settings配置和pom、idea配置关系
java·maven·intellij-idea
咕噜企业分发小米16 小时前
阿里云与华为云基因测序数据分析如何实现数据协同?
阿里云·华为云·云计算
数据库知识分享者小北16 小时前
从极速复制“死了么”APP,看AI编程时代的技术选型
数据库·阿里云·状态模式·ai编程·supabase
咕噜企业分发小米16 小时前
阿里云与华为云基因测序数据分析中如何实现数据共享?
阿里云·华为云·云计算