时隔多年pip和maven也要加速
如果要加速pip, 需要访问阿里云官网: https://developer.aliyun.com/mirror/pypi?spm=a2c6h.13651102.0.0.3e221b11cWW3JM
vi ~/.pip/pip.conf
添加下面的内容, 这个内容要跟随阿里云的文档更新, 网上的内容很可能已经过期了.
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
这个真心不一定有用……
maven也需要
code ~/.m2/settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
<mirror>
<id>aliyunmaven</id>
<mirrorOf>*</mirrorOf>
<name>阿里云公共仓库</name>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>
</mirrors>
</settings>
- https://help.aliyun.com/document_detail/102512.html?spm=a2c40.aliyun_maven_repo.0.0.361865e9YIikNx#h2-u914Du7F6Eu6307u53572
spring和gradle也可以加速, groovy文件.
code ~/.gradle/gradle.properties
allProjects { //设置镜像
repositories {
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url 'https://maven.aliyun.com/repository/spring/'}
mavenLocal()
mavenCentral()
}
}
org.gradle.daemon=true //这个能加速编译, 打开daemon
org.gradle.jvmargs=-Xmx5120m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
//开内存
org.gradle.parallel=true //开并行