2015-09-18 32 views
0

我有一個可以在AWS上運行的pom.xml,但是在代理工作的背後卻沒有。我已經嘗試了這篇文章中的所有內容Maven proxy settings not working,但沒有任何工作。pom.xml有效,但代理設置不起作用?

下面是使用MVN幫助錯誤:有效的設置

... 
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 
Downloading:https://repo.maven.apache.org/maven2/org/codehaus/mojo/mavenmetadata.xml 
Downloading:https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml 
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org 
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xmlfrom/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org 
[WARNING] Failure to transfer org.apache.maven.plugins/maven-metadata.xmlfrom https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org 
[WARNING] Failure to transfer org.codehaus.mojo/maven-metadata.xml fromhttps://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updatesare forced. Original error: Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org 
... 
[ERROR] No plugin found for prefix 'help' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\David.Wynter\.m2\repository),central(https://repo.maven.apache.org/maven2)] -> [Help 1] 

這裏是我的settings.xml的相關部分

<proxies> 
    <proxy> 
     <active>true</active> 
     <protocol>http</protocol> 
     <host>10.***.0.60</host> 
     <port>8080</port> 
     <username>dmgp\david.blow</username> 
     <password>*******</password> 
     <nonProxyHosts>localhost|127.0.0.1</nonProxyHosts> 
    </proxy> 
</proxies> 

主機等來自PAC的設置適用於瀏覽器的文件。有任何想法嗎?

我也想加入這個

<extensions> 
     <extension> 
      <!-- this extension is required by wagon in order to pass the proxy --> 
      <groupId>org.apache.maven.wagon</groupId> 
      <artifactId>wagon-http-lightweight</artifactId> 
      <version>2.2</version> 
     </extension> 
    </extensions> 

爲了我的pom.xml並補充說,罈子我的Maven的安裝lib目錄,但得到這個

[ERROR]  Unresolveable build extension: Plugin org.apache.maven.wagon:wagon-http-lightweight:2.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.wagon:wagon-http-lightweight:jar:2.2: Could not transfer artifact org.apache.maven.wagon:wagon-http-lightweight:pom:2.2 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Unknown host repo.maven.apache.org -> [Help 2] 
+0

你有什麼maven版本? –

+0

難道你不應該把那個罐子添加到你的回購中嗎? ,如果你的回購是在c:\ users \ \ .m2 \ repository \ org \ apache \ maven \ wagon \ 2.2 \ wagon-http-lightweight.jar –

+0

使用「mvn -X」來檢查您是否使用正確設置文件。一旦你執行了這個命令,你就會看到很多信息,包括你是否正在使用如下的正確文件。 [DEBUG]從/usr/java/apache-maven-3.0.3/conf/settings.xml讀取全局設置 [DEBUG]從/home/myhome/.m2/settings.xml讀取用戶設置 –

回答

1

你已經配置爲使用http代理而Maven的輸出告訴你它正在使用https