如何设置maven代理

thi*_*nwa 1 proxy maven

我试图在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]
Run Code Online (Sandbox Code Playgroud)

我搜索了错误消息,然后在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]
Run Code Online (Sandbox Code Playgroud)

有谁知道什么是错的?

添加代理设置:

<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>
Run Code Online (Sandbox Code Playgroud)

Jaa*_*p D 7

它可能是一个NTLM代理?如果是:

http://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-http-lightweight/2.2/wagon-http-lightweight-2.2下载wagon-http-lightweight-2.2.jar .罐

将wagon-http-lightweight-2.2.jar复制到%M2_HOME%/ lib/ext文件夹.