maven、npm、pip、yum官方镜像修改文档

文章目录

由于各博客繁杂,本文旨在记录各常见镜像官网,及其配置文档。常用镜像及配置可评论后加入

Maven

阿里云

官方文档

setting.xml

xml 复制代码
<mirror>
    <id>aliyunmaven</id>
    <mirrorOf>*</mirrorOf>
    <name>阿里云公共仓库</name>
    <url>https://maven.aliyun.com/repository/public</url>
</mirror>

或者pom.xml

xml 复制代码
<repository>
    <id>spring</id>
    <url>https://maven.aliyun.com/repository/spring</url>
    <releases>
        <enabled>true</enabled>
    </releases>
    <snapshots>
        <enabled>true</enabled>
    </snapshots>
</repository>

网易

官方文档

setting.xml

xml 复制代码
<mirror>
    <id>nexus-163</id>
    <mirrorOf>*</mirrorOf>
    <name>Nexus 163</name>
    <url>http://mirrors.163.com/maven/repository/maven-public/</url>
</mirror>

或者pom.xml

xml 复制代码
<repositories>
    <repository>
        <id>nexus-163</id>
        <name>Nexus 163</name>
        <url>http://mirrors.163.com/maven/repository/maven-public/</url>
        <layout>default</layout>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <releases>
            <enabled>true</enabled>
        </releases>
    </repository>
</repositories>
<pluginRepositories>
    <pluginRepository>
        <id>nexus-163</id>
        <name>Nexus 163</name>
        <url>http://mirrors.163.com/maven/repository/maven-public/</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <releases>
            <enabled>true</enabled>
        </releases>
    </pluginRepository>
</pluginRepositories>

华为

官方文档
PDF

setting.xml

xml 复制代码
<mirror>
    <id>huaweicloud</id>
    <mirrorOf>*</mirrorOf>
    <url>https://repo.huaweicloud.com/repository/maven/</url>
</mirror>

腾讯云

官方文档

setting.xml

xml 复制代码
<mirror>
    <id>nexus-tencentyun</id>
    <mirrorOf>*</mirrorOf>
    <name>Nexus tencentyun</name>
    <url>https://mirrors.tencent.com/nexus/repository/maven-public/</url>
 </mirror> 

Npm

淘宝

官方文档

shell 复制代码
npm config set registry https://registry.npmmirror.com

cnpm

shell 复制代码
npm install -g cnpm --registry=https://registry.npmmirror.com

腾讯云

官方文档

shell 复制代码
npm config set registry https://mirrors.tencent.com/npm/

pip

清华源

官方文档

临时使用

shell 复制代码
pip install -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple some-package

设为默认

shell 复制代码
pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple

阿里

官方文档

a. 找到下列文件

xml 复制代码
~/.pip/pip.conf

b. 在上述文件中添加或修改:

xml 复制代码
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host=mirrors.aliyun.com

中科大

官方文档

临时使用

shell 复制代码
pip install -i https://mirrors.ustc.edu.cn/pypi/simple package

设为默认

升级 pip 到最新的版本 (>=10.0.0) 后进行配置:

使用本镜像站来升级 pip

shell 复制代码
pip install -i https://mirrors.ustc.edu.cn/pypi/simple pip -U
pip config set global.index-url https://mirrors.ustc.edu.cn/pypi/simple

华科

官方文档

shell 复制代码
curl -sSfL https://mirrors.hust.edu.cn/get | sh -s -- autodeploy #或者采用 ad

Yum

官方文档

shell 复制代码
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

更新镜像源

shell 复制代码
清除缓存:yum clean all
生成缓存:yum makecache
相关推荐
过期动态4 小时前
Java开发中的@EnableWebMvc注解和WebMvcConfigurer接口
java·开发语言·spring boot·spring·tomcat·maven·idea
A懿轩A4 小时前
【Maven 构建工具】从零到上手 Maven:安装配置 + IDEA 集成 + 第一个项目(保姆级教程)
java·maven·intellij-idea
Warren9810 小时前
Pytest Fixture 作用域详解:Function、Class、Module、Session 怎么选
面试·职场和发展·单元测试·pytest·pip·模块测试·jira
i建模13 小时前
在 Ubuntu 中为 npm 切换国内镜像源
linux·ubuntu·npm
弹简特13 小时前
【JavaEE04-后端部分】Maven 小介绍:Java 开发的构建利器基础
java·maven
计算机毕设指导613 小时前
基于微信小程序的智能停车场管理系统【源码文末联系】
java·spring boot·微信小程序·小程序·tomcat·maven·intellij-idea
每天瞎忙的农民工13 小时前
Ubuntu 24 安装npm22
linux·运维·ubuntu·npm
A懿轩A14 小时前
【Maven 构建工具】Maven 依赖管理详解:坐标、传递、作用域与依赖冲突解决(一篇搞懂)
java·linux·maven
孪生质数-1 天前
Windows安装OpenClaw(Clawdbot)教程
ai·npm·skill·minimax·clawdbot·openclaw
无尽的沉默1 天前
使用Spring Initializr 快速创建Maven管理的springBoot项目
spring boot·spring·maven