Maven错误 - 授权失败:未经代理授权

时间:2011-03-01 06:47:46

标签: maven authorization

我正在尝试在ubuntu中构建opennms。但是当我在终端中给./compile.pl(用于编译opennms源代码)时,我得到以下错误。 我正在使用maven 2.2.1版本。 请有人提供解决方案。

注意:删除了像stacktrace中的http这样的超链接..

[WARNING] Unable to get resource 'org.apache.felix:maven-bundle-plugin:pom:1.4.3' from repository java-net-repo (http://maven.opennms.org/content/groups/java.net-release): Authorization failed: Not authorized by proxy.
Downloading: //repo1.maven.org/maven2/org/apache/felix/maven-bundle-plugin/1.4.3/maven-bundle-plugin-1.4.3.pom
[WARNING] Unable to get resource 'org.apache.felix:maven-bundle-plugin:pom:1.4.3' from repository central (repo1.maven.org/maven2): Authorization failed: Not authorized by proxy.
Downloading: http://maven.opennms.org/content/groups/opennms.org-release/org/apache/felix/maven-bundle-plugin/1.4.3/maven-bundle-plugin-1.4.3.pom
[WARNING] Unable to get resource 'org.apache.felix:maven-bundle-plugin:pom:1.4.3' from repository opennms-repo (maven.opennms.org/content/groups/opennms.org-release): Authorization failed: Not authorized by proxy.
Downloading: repo1.maven.org/maven2/org/apache/felix/maven-bundle-plugin/1.4.3/maven-bundle-plugin-1.4.3.pom
[WARNING] Unable to get resource 'org.apache.felix:maven-bundle-plugin:pom:1.4.3' from repository central (//repo1.maven.org/maven2): Authorization failed: Not authorized by proxy.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).

2 个答案:

答案 0 :(得分:7)

确保您拥有正确的用户名&设置文件中代理身份验证的密码。

 <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>

http://maven.apache.org/guides/mini/guide-proxies.html

答案 1 :(得分:0)

Raghu和Arun,

非常感谢。我能够用maven构建。我做的是,我删除了maven并重新安装了与opennms捆绑的版本相同的版本,并且还没有更改maven中的settings.xml(在opennms中)。