开发环境搭建 - 各种代理/加速配置

身在大中华区局域网,有些时候更新各种开发包速度非常非常非常慢,这篇文章集合常见开发语言的国内源的配置。

ruby

1
$ gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/

参考:ruby-china

python

临时使用

1
pip install pythonModuleName -i http://pypi.douban.com --trusted-host=pypi.douban.com

修改配置文件

~/.pip/pip.conf
1
2
3
[global]
index-url = http://pypi.douban.com/simple
trusted-host = pypi.douban.com

参考:
pip 更换软件镜像源
pip configuration

maven

maven/conf/setting.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<repositories>
<repository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

参考:Maven 中央(或国内)仓库地址

gredle

project/.gradle/gradle.properties
1
2
3
4
5
6
7
8
9
10
11
systemProp.http.proxyHost=www.proxyhost.org
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=userid
systemProp.http.proxyPassword=password
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost
systemProp.https.proxyHost=www.proxyhost.org
systemProp.https.proxyPort=8080
systemProp.https.proxyUser=userid
systemProp.https.proxyPassword=password
systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost

参考:gradle代理设置

Gavin Liu wechat
欢迎您扫一扫上面的二维码,订阅我的微信公众号!