【发布时间】:2013-08-01 08:41:19
【问题描述】:
我尝试在 NetBeans 7.4 中设置 maven 代理,因为我在代理后面。我从工具>选项>常规>代理设置在NetBeans中设置代理,它工作正常。但是当我尝试构建我的项目时仍然出现错误。
Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org: Unknown host repo.maven.apache.org -> [Help 1]
我google了错误信息,然后在maven的settings.xml文件中设置了相同的代理,但又出现了错误。
Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): Not authorized by proxy , ReasonPhrase:Proxy Authentication Required. -> [Help 1]
有谁知道怎么回事?
添加代理设置:
<proxies>
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
|-->
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<host>proxyhost</host>
<port>8080</port>
<nonProxyHosts>localhost|*.google.com.*</nonProxyHosts>
</proxy>
</proxies>
【问题讨论】:
-
请发布您的 maven 本地存储库 settings.xml
-
添加了代理设置。