Ubuntu下maven配置代理和镜像
配置镜像
配置maven修改
sudo vi /etc/maven/settings.xml
阿里云镜像
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
复制配置
将该配置文件复制到用户目录,使得每次对maven创建时,都采用该配置:
cp /etc/maven/settings.xml ~/.m2/
配置代理
在${user.home}/.m2/settings.xml下
[...]
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>proxy.somewhere.com</host>
<port>8080</port>
<username>proxyuser</username>
<password>somepassword</password>
<nonProxyHosts>www.google.com|*.somewhere.com</nonProxyHosts>
</proxy>
</proxies>
[...]
</settings>

浙公网安备 33010602011771号