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

相关推荐
lang2015092814 小时前
Maven 4:20年老工具的重生之路
java·maven
吉普赛的歌15 小时前
【阿里云】ECS服务器重启需要注意的事项
运维·服务器·阿里云
深耕AI16 小时前
【端口的核心区别】阿里云安全组:80、443和16251
安全·阿里云·云计算
chxii1 天前
Maven 详解(上)
java·maven
平凡而伟大(心之所向)1 天前
云架构设计与实践:从基础到未来趋势
人工智能·阿里云·系统架构·安全架构
极小狐1 天前
极狐GitLab 18.5 正式发布,更新 Maven 虚拟仓库 UI(Beta)、全新个人主页、实例级合规与安全策略管理 以及 DAST 认证脚本 等
java·gitlab·maven
eddy-原1 天前
阿里云核心服务解析与应用实践
linux·运维·阿里云·云计算
codingPower1 天前
升级mybatis-plus导致项目启动报错: net.sf.jsqlparser.statement.select.SelectBody
java·spring boot·maven·mybatis
tnan25221 天前
基于阿里云效实现cicd记录
阿里云·ci/cd·docker·容器·自动化
lijun_xiao20091 天前
DevOps(devops/k8s/docker/Linux)学习笔记-4
docker·kubernetes·devops