设置的在window-Preferences-Maven-User Setting中,里面是我的实际路径,大家可以根据实际情况修改
第一种,不配代理的完整代码
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<localRepository>C:\Users\it室\.m2\repository</localRepository> <proxies>
</proxies>
<mirrors>
<mirror>
<id>nextus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<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>
</profile></profiles>
</settings>
第二种配置代理的完整代码(需要修改代理IP(host),端口(port),账号(username),密码(password))
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<localRepository>C:\Users\it室\.m2\repository</localRepository> <proxies>
<proxy>
<id>myProxy</id>
<active>true</active>
<protocol>http</protocol>
<host>xx.xx.xx.xx</host>
<port>8080</port>
<username>xxx</username>
<password>xxx</password>
<nonProxyHosts></nonProxyHosts>
</proxy>
</proxies>
<mirrors>
<mirror>
<id>nextus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<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>
</profile></profiles>
</settings>