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 小时前
还不会部署OpenClaw?阿里云推出五种OpenClaw快速部署方案
阿里云·云计算
Re.不晚10 小时前
可视化大数据——淘宝母婴购物数据【含详细代码】
大数据·阿里云·云计算
MoMoSQL66615 小时前
2026年1月国产数据库大事记:国开行2822万采购Gbase,浙商银行930万采购GoldenDB,墨天轮发布“2025年度数据库”……
数据库·阿里云·tidb·oceanbase·gaussdb
WZ1881046386919 小时前
DevOps面试116个热门问题及答案
运维·面试·devops
yuankoudaodaokou20 小时前
国产三维扫描仪市场占有率第一是谁?思看科技16.3%份额领跑手持与跟踪式领域
阿里云
重生之后端学习21 小时前
Maven基础
java·spring boot·spring·html·maven·mybatis
indexsunny1 天前
互联网大厂Java求职面试实战:Spring Boot与微服务在电商场景中的应用
java·数据库·spring boot·spring cloud·微服务·kafka·maven
番茄去哪了2 天前
苍穹外卖day03-----菜品管理
java·开发语言·数据库·ide·git·学习·maven
黑桃52002 天前
闲鱼自动发货工具实测对比:为什么我最终选择了闲管家
百度·阿里云·微信·墨刀
zhifou1234562 天前
Heic文件转jpg标准解决方案(libheif安装)
java·图像处理·github·maven·iphone