2011-03-01 172 views
2

我想在ubuntu.But中构建opennms,当我在终端中给./compile.pl(用于编译opennms源代码)时,我得到下面的错误。 我使用maven 2.2.1版本。 任何人都可以请提供一个解决方案。Maven错误 - 授权失败:未经代理授权

注:除去像堆栈跟踪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). 

回答

6

确保您有正确的用户名密码&在你的设置文件的代理认证。

<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

+0

嗨Arun,thnks.I配置了代理并测试了简单的maven示例,工作正常。但是当我构建源代码(compile.pl)时出现此错误。 – maali 2011-03-01 07:32:17

0

Raghu和阿伦,

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