【问题标题】:Maven Error- Authorization failed: Not authorized by proxyMaven 错误 - 授权失败:未经代理授权
【发布时间】:2017-08-24 21:44:36
【问题描述】:

我正在尝试在 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).

【问题讨论】:

    标签: maven authorization


    【解决方案1】:

    确保您在设置文件中具有用于代理身份验证的正确用户名和密码。

     <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

    【讨论】:

    • 嗨 Arun,谢谢。我已经配置了代理并测试了简单的 maven 示例,工作正常。但是当我构建源代码(compile.pl)时出现此错误。
    【解决方案2】:

    拉古和阿伦,

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

    【讨论】:

      猜你喜欢
      • 2015-12-11
      • 2021-09-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多