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的方式来修改。

相关推荐
chushiyunen20 小时前
阿里云部署dify笔记
笔记·阿里云·云计算
翼龙云_cloud1 天前
阿里云代理商:2026年阿里云OpenClaw部署培育指南
阿里云·云计算·云服务器
Database_Cool_1 天前
PolarDB分布式版 AI 助手正式上线:你的“数字DBA”已入职
数据库·阿里云·ai
洒满阳光的午后1 天前
一个基于Runbook的版本发布系统设计思路
devops·cicd
暗暗别做白日梦1 天前
Maven与Spring Cloud SpringBoot核心配置文件解析
spring cloud·maven
李少兄1 天前
Windows 安装 Maven 详细教程(含镜像与本地仓库配置)
java·windows·maven
TG_yunshuguoji1 天前
阿里云代理商:OpenClaw+K8s协同运维 常见问题解决方案
人工智能·阿里云·kubernetes·云计算·openclaw
Datawhale1 天前
阿里云新产品开放内测!
阿里云·云计算
数据库知识分享者小北1 天前
告别后端上下文断层!体验用 PolarDB Supabase 助力 AI 原生 IDE 完成 VibeCoding领取试用及多重好礼
数据库·人工智能·阿里云·关系型数据库·polardb·vibecoding
.柒宇.1 天前
LLM大模型认识
人工智能·深度学习·神经网络·阿里云·ai