joelittlejohn / embedmongo-maven-plugin

Maven plugin wrapper for the flapdoodle.de embedded MongoDB API
Apache License 2.0
88 stars 51 forks source link

Proxy settings are not used #58

Closed agoston closed 8 years ago

agoston commented 8 years ago

In 0.2.1-SNAPSHOT, you've moved the proxy config to maven. Since then, proxy support is broken:

<settings>
<proxies>
        <proxy>
        <id>egy</id>
            <active>true</active>
            <protocol>https</protocol>
            <host>does.not.exist</host>
            <port>3128</port>
        </proxy>
        <proxy>
            <active>true</active>
            <protocol>http</protocol>
            <host>does.not.exist</host>
            <port>3128</port>
        </proxy>
    </proxies>
</settings>

it just goes on and download. Also with valid hostnames, but it is still not using them.

joelittlejohn commented 8 years ago

Thanks for raising this. What Maven version are you using?

joelittlejohn commented 8 years ago

I see also that I managed to leave the proxyHost/proxyPort/proxyUser/proxyPassword config properties present. This wasn't intentional - I've now removed these to avoid confusion.

agoston commented 8 years ago
$ mvn --version
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T13:57:37+02:00)
Maven home: /usr/local/Cellar/maven/3.3.3/libexec
Java version: 1.8.0_60, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.5", arch: "x86_64", family: "mac"
joelittlejohn commented 8 years ago

This is caused by a change in the way Java 8 creates connections and selects a proxy when using URLConnection. The plugin is correctly installing a ProxySelector that will return the proxy as configured in your Maven settings, however the URI being proxied (in Java 8) is now socket://fastdl.mongodb.org:80 instead of http://fastdl.mongodb.org and the HTTP proxy returned by our custom ProxySelector is not used.

Thankfully the flapdoodle embedprocess API now supports proxying in its own API, so we no longer have to install a ProxySelector to achieve what we need here. I've switched the proxy logic over to setup an embedprocess IProxyFactory instead, and this is working well again.

Thanks again for reporting this, I'll release this ASAP!

agoston commented 8 years ago

Thanks!