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

相关推荐
多多*1 天前
分布式系统中的CAP理论和BASE理论
java·数据结构·算法·log4j·maven
阿里云大数据AI技术1 天前
让 ETL 更懂语义:DataWorks 支持数据集成 AI 辅助处理能力
人工智能·阿里云·dataworks·ai辅助
佐杰1 天前
什么是DevOps
运维·devops
Serverless社区1 天前
助力企业构建 AI 原生应用,函数计算FunctionAI 重塑模型服务与 Agent 全栈生态
阿里云·云原生·serverless
多多*1 天前
牛客周赛 Round 117 ABCDE 题解
java·开发语言·数据结构·算法·log4j·maven
baviya1 天前
一文彻底搞懂 Maven 依赖——从 <dependency> 到依赖冲突,带你看懂 Maven 的“江湖规矩”
java·maven
观测云1 天前
阿里云 RDS PostgreSQL 可观测最佳实践
阿里云·postgresql·云计算
飞哥专栏2 天前
阿里云效 = Jenkins + Gitlab + 免费服务器
阿里云·gitlab·jenkins
chinesegf2 天前
[特殊字符] 常用 Maven 命令
java·spring boot·maven
竹君子2 天前
研发管理知识库(1)DevOps开发模式简介
运维·devops