Archiva 2.2.0。在VM上启动并运行(CentOS 6.6)。 VM可以访问代理后面的Internet。
例如,GET repo1.maven.org
效果很好:
...
<body>
<div id="top"></div>
<div id="container">
<p>Browsing for this directory has been disabled.</p>
<p><a href="http://search.maven.org/#browse">View</a> this directory's contents on <a href="http://search.maven.org/#browse">http://search.maven.org</a> instead.</p>
<p>Find out more about <a href="http://central.sonatype.org">The Central Repository</a>.</p>
<div id="footer-spacer"></div>
</div>
<div id="footer">
<a href="http://central.sonatype.org">About Central</a> | <a href="/terms.html">Terms of Service</a>
</div>
</body>
...
配置了两个远程存储库,两者都使用相同的代理。
但不幸的是,我总是得到相同的连接超时异常。请参阅下面的配置远程存储库(中央)之一的异常。
来自 archiva.log :
2015-06-01 10:24:55,286 [taskScheduler#indexDownloadRemote-1] INFO org.apache.archiva.scheduler.indexing.DownloadRemoteIndexTask$DownloadListener [] - error of transfer file nexus-maven-repository-index.properties: Connect to repo1.maven.org:80 timed out
org.apache.maven.wagon.TransferFailedException: Connect to repo1.maven.org:80 timed out
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:892) ~[wagon-http-2.5.jar:2.5]
at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116) [wagon-provider-api-2.5.jar:2.5]
at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88) [wagon-provider-api-2.5.jar:2.5]
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61) [wagon-provider-api-2.5.jar:2.5]
at org.apache.archiva.scheduler.indexing.DownloadRemoteIndexTask$WagonResourceFetcher.retrieve(DownloadRemoteIndexTask.java:351) [archiva-scheduler-indexing-2.2.0.jar:?]
at org.apache.maven.index.updater.DefaultIndexUpdater.downloadIndexProperties(DefaultIndexUpdater.java:459) [indexer-core-5.1.1.jar:5.1.1]
at org.apache.maven.index.updater.DefaultIndexUpdater.access$000(DefaultIndexUpdater.java:76) [indexer-core-5.1.1.jar:5.1.1]
at org.apache.maven.index.updater.DefaultIndexUpdater$IndexAdaptor.setProperties(DefaultIndexUpdater.java:589) [indexer-core-5.1.1.jar:5.1.1]
at org.apache.maven.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:814) [indexer-core-5.1.1.jar:5.1.1]
at org.apache.maven.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:136) [indexer-core-5.1.1.jar:5.1.1]
at org.apache.archiva.scheduler.indexing.DownloadRemoteIndexTask.run(DownloadRemoteIndexTask.java:186) [archiva-scheduler-indexing-2.2.0.jar:?]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-4.1.4.RELEASE.jar:4.1.4.RELEASE]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [?:1.7.0_65]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [?:1.7.0_65]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178) [?:1.7.0_65]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292) [?:1.7.0_65]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [?:1.7.0_65]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [?:1.7.0_65]
at java.lang.Thread.run(Thread.java:745) [?:1.7.0_65]
Caused by: org.apache.http.conn.ConnectTimeoutException: Connect to repo1.maven.org:80 timed out
at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:119) ~[httpclient-4.3.6.jar:4.3.6]
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:177) ~[httpclient-4.3.6.jar:4.3.6]
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:304) ~[httpclient-4.3.6.jar:4.3.6]
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611) ~[httpclient-4.3.6.jar:4.3.6]
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446) ~[httpclient-4.3.6.jar:4.3.6]
来自请求 - * .log :
IP - - [01/juin/2015:08:47:55 +0000] "GET /restServices/archivaServices/remoteRepositoriesService/checkRemoteConnectivity/central?_=1433145022958 HTTP/1.1" 200 5 "http://$$$$$$$$$$/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36"
IP - - [01/juin/2015:08:46:54 +0000] "GET /restServices/archivaServices/remoteRepositoriesService/checkRemoteConnectivity/repo.jenkins-ci.org?_=1433145022952 HTTP/1.1" 200 5 "http://$$$$$$$$$$/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36"
我错过了什么吗? 谢谢!
答案 0 :(得分:0)
您需要配置https://repo.maven.apache.org/maven2 并设置https代理。
因为即使您http://repo.maven.apache.org/maven2存在重定向https协议。
这应该有效。
HTH 奥利弗