I'm using Maven 3.1.1 behind a proxy server. The same proxy handles both HTTP
and HTTPS
traffic.
I can't seem to tell maven using settings.xml
to use both protocols. It seems to me that it is only possible to have one active proxy, as whichever active proxy is defined first is used, and subsequent 'active' proxy definitions are ignored. This is my settings.xml
:
<proxies>
<proxy>
<id>myhttpproxy</id>
<active>true</active>
<protocol>http</protocol>
<host>192.168.1.2</host>
<port>3128</port>
<nonProxyHosts>localhost</nonProxyHosts>
</proxy>
<proxy>
<id>myhttpsproxy</id>
<active>true</active>
<protocol>https</protocol>
<host>192.168.1.2</host>
<port>3128</port>
<nonProxyHosts>localhost</nonProxyHosts>
</proxy>
</proxies>
Is it possible to configure a proxy for both HTTP
and HTTPS
in maven's settings.xml
? I'm aware that I could workaround this by passing Java system properties to the maven invocation such as:
-Dhttps.proxyHost=192.168.1.2 -Dhttps.proxyPort=3128
but surely this must be possible from within settings.xml
?
Maven bugs raised such as MNG-2305 and MNG-4394 suggest this issue is resolved, but I am not convinced.
Alternatively, is there a "proxy proxy" I could run locally that I could point maven to? The "proxy proxy" would route http/https accordingly. Even so, I would still need to define two active proxy definitions in settings.xml
for Maven to direct both types of traffic.
question from:
https://stackoverflow.com/questions/31032174/how-to-configure-a-proxy-server-for-both-http-and-https-in-mavens-settings-xml 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…