1.配置proxy
<proxies>
<proxy>
<id>my-proxy</id>
<active>true</active>
<protocol>http</protocol>
<host>10.57.76.76</host>
<port>3128</port>
<nonProxyHosts>*10.*</nonProxyHosts>
</proxy>
</proxies>
2.如果遇到https问题,可配置中央仓库为http
参考:https://stackoverflow.com/questions/25911623/problems-using-maven-and-ssl-behind-proxy
<settings>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>securecentral</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>securecentral</id>
<!--Override the repository (and pluginRepository) "central" from the
Maven Super POM -->
<repositories>
<repository>
<id>central</id>
<url>http://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>
PS: proxy搭建可使用" cntlm"搭建代理