ctron / package-drone

An OSGI first software artifact repository – Moved to the Eclipse Foundation
https://github.com/eclipse/packagedrone
Eclipse Public License 1.0
39 stars 13 forks source link

Eclipse Aether does not use http proxy #125

Closed SvenEwald closed 9 years ago

SvenEwald commented 9 years ago

Version 0.10.3 1- In file "server" add JAVA_OPTS with -Dhttp.proxyHost and proxyPort 2- In PD, go to "Import From a Maven repository" 3- Enter some coordinates (e.g. org.xmlbeam:xmlprojector:1.4.7 ;-) 4- Click Validate

NOK: Result is an UnknownHostException: central.maven.org NOK: Proxy is not used.

Expected:The proxy should be asked for the URL contents.

Stacktrace: Caused by: java.net.UnknownHostException: central.maven.org: unknown error at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method) ~[na:1.8.0_51] at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928) ~[na:1.8.0_51] at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323) ~[na:1.8.0_51] at java.net.InetAddress.getAllByName0(InetAddress.java:1276) ~[na:1.8.0_51] at java.net.InetAddress.getAllByName(InetAddress.java:1192) ~[na:1.8.0_51] at java.net.InetAddress.getAllByName(InetAddress.java:1126) ~[na:1.8.0_51] at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:44) ~[org.apache.httpcomponents.httpclient_4.3.6.v201411290715.jar:4.3.6] at org.apache.http.impl.conn.DefaultClientConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:259) ~[org.apache.httpcomponents.httpclient_4.3.6.v201411290715.jar:4.3.6] at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:159) ~[org.apache.httpcomponents.httpclient_4.3.6.v201411290715.jar:4.3.6] at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:304) ~[org.apache.httpcomponents.httpclient_4.3.6.v201411290715.jar:4.3.6] at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611) ~[org.apache.httpcomponents.httpclient_4.3.6.v201411290715.jar:4.3.6] at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446) ~[org.apache.httpcomponents.httpclient_4.3.6.v201411290715.jar:4.3.6] at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863) ~[org.apache.httpcomponents.httpclient_4.3.6.v201411290715.jar:4.3.6] at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72) ~[org.apache.httpcomponents.httpclient_4.3.6.v201411290715.jar:4.3.6] at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57) ~[org.apache.httpcomponents.httpclient_4.3.6.v201411290715.jar:4.3.6] at org.apache.http.impl.client.DecompressingHttpClient.execute(DecompressingHttpClient.java:158) ~[org.apache.httpcomponents.httpclient_4.3.6.v201411290715.jar:4.3.6] at org.eclipse.aether.transport.http.HttpTransporter.execute(HttpTransporter.java:287) ~[org.eclipse.aether.transport.http_1.0.1.v20141111.jar:na] at org.eclipse.aether.transport.http.HttpTransporter.implGet(HttpTransporter.java:243) ~[org.eclipse.aether.transport.http_1.0.1.v20141111.jar:na] at org.eclipse.aether.spi.connector.transport.AbstractTransporter.get(AbstractTransporter.java:59) ~[org.eclipse.aether.spi_1.0.1.v20141111.jar:na] at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:447) ~[org.eclipse.aether.connector.basic_1.0.1.v20141111.jar:na] at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:350) ~[org.eclipse.aether.connector.basic_1.0.1.v20141111.jar:na]

ctron commented 9 years ago

True!

ctron commented 9 years ago

Maven Aether seems to bring in a complete own proxy system.

For now I tried to let Java choose a proxy by using the ProxySelector and then extract the information from it to fill the Aether Proxy information.

This should work for most scenarios, but I guess a more generic approach for all http based connections must be built in the future.