问题
I setup apache archiva using simple way
archiva start
I am using default internal repository to test connection to central by executing following from my browser
http://localhost:8080/repository/internal/junit/junit/3.8.1/junit-3.8.1.jar
I get it in ./logs/archiva.log
2016-04-28 13:11:42,351 [qtp957020437-29] WARN org.apache.archiva.proxy.DefaultRepositoryProxyConnectors [] - Transfer error from repository central for artifact junit:junit:3.8.1::pom , continuing to next repository. Error message: Download failure on resource [https://repo.maven.apache.org/maven2/junit/junit/3.8.1/junit-3.8.1.pom]:Connection reset (cause: java.net.SocketException: Connection reset)
2016-04-28 13:11:42,351 [qtp957020437-29] ERROR org.apache.archiva.webdav.ArchivaDavResourceFactory [] - Failures occurred downloading from some remote repositories:
central: Download failure on resource [https://repo.maven.apache.org/maven2/junit/junit/3.8.1/junit-3.8.1.pom]:Connection reset (cause: java.net.SocketException: Connection reset)
org.apache.archiva.policies.ProxyDownloadException: Failures occurred downloading from some remote repositories:
central: Download failure on resource [https://repo.maven.apache.org/maven2/junit/junit/3.8.1/junit-3.8.1.pom]:Connection reset (cause: java.net.SocketException: Connection reset)
at org.apache.archiva.proxy.DefaultRepositoryProxyConnectors.fetchFromProxies(DefaultRepositoryProxyConnectors.java:367) ~[archiva-proxy-2.2.0.jar:?]
at org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryStorage.applyServerSideRelocation(Maven2RepositoryStorage.java:670) ~[maven2-repository-2.2.0.jar:?]
at org.apache.archiva.webdav.ArchivaDavResourceFactory.fetchContentFromProxies(ArchivaDavResourceFactory.java:818) [archiva-webdav-2.2.0.jar:?]
at org.apache.archiva.webdav.ArchivaDavResourceFactory.processRepository(ArchivaDavResourceFactory.java:629) [archiva-webdav-2.2.0.jar:?]
at org.apache.archiva.webdav.ArchivaDavResourceFactory.createResource(ArchivaDavResourceFactory.java:325) [archiva-webdav-2.2.0.jar:?]
at org.apache.archiva.webdav.RepositoryServlet.service(RepositoryServlet.java:125) [archiva-webdav-2.2.0.jar:?]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) [javax.servlet-3.0.0.v201112011016.jar:?]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684) [jetty-servlet-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501) [jetty-servlet-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) [jetty-server-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557) [jetty-security-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) [jetty-server-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086) [jetty-server-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428) [jetty-servlet-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) [jetty-server-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020) [jetty-server-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) [jetty-server-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255) [jetty-server-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154) [jetty-server-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) [jetty-server-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.server.Server.handle(Server.java:370) [jetty-server-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494) [jetty-server-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971) [jetty-server-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033) [jetty-server-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644) [jetty-http-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) [jetty-http-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) [jetty-server-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667) [jetty-io-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) [jetty-io-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) [jetty-util-8.1.14.v20131031.jar:8.1.14.v20131031]
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) [jetty-util-8.1.14.v20131031.jar:8.1.14.v20131031]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_73]
I setup network proxy in archiva web interface and choose it in "Remove repository management" / "Proxy for Remote Download Index"
Also we are using non standard root cecurity certificate that was added to jdk trusted storage (local maven repository works fine).
Any idea how to make it work?
回答1:
In accoriding to: here proxy is not working in archiva. I've tried to get snapshot-2.2.1 build from source but it was too slow. Switched to Nexus
回答2:
The following solution is for http only.
- Modify the default repository entry: switch to Administration > Repositories > Remote Repositories Management
- click "edit" on the default repository entry (Name: Central Repository)
- Change the URL entry from "https://repo.maven.apache.org/maven2" to "http://repo.maven.apache.org/maven2"
- Configure your proxy in Archiva: http://:/#networkproxies
- Switch to Administration > Repositories > Remote Repositories Management
- click "edit" on the default repository entry (Name: Central Repository)
- Locate the entry "Proxy for Remote Download Index" and choose the proxy configured in step 1. My setup has both http and https proxies defined.
- Now click on "Repositories" and click the green button "Download Remote Index" for the "Central Repository"
Again: the solution is for http only. If one wants to use https the appropriate certificates have to be downloaded and manually imported. Nexus 3 offers a nice import functionality, but lacks other features and is not an option for me.
来源:https://stackoverflow.com/questions/36905185/apache-archiva-not-able-to-connect-to-central