title: How to configure a proxy server for both HTTP and HTTPS in Maven's settings.xml?
body: <p>I'm using Maven 3.1.1 behind a proxy server. The same proxy handles both <code>HTTP</code> and <code>HTTPS</code> traffic.</p>
  
  <p>I can't seem to tell maven using <code>settings.xml</code> 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 <code>settings.xml</code>:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;proxies&gt;
      &lt;proxy&gt;
          &lt;id&gt;myhttpproxy&lt;/id&gt;
          &lt;active&gt;true&lt;/active&gt;
          &lt;protocol&gt;http&lt;/protocol&gt;
          &lt;host&gt;192.168.1.2&lt;/host&gt;
          &lt;port&gt;3128&lt;/port&gt;
          &lt;nonProxyHosts&gt;localhost&lt;/nonProxyHosts&gt;
      &lt;/proxy&gt;
      &lt;proxy&gt;
          &lt;id&gt;myhttpsproxy&lt;/id&gt;
          &lt;active&gt;true&lt;/active&gt;
          &lt;protocol&gt;https&lt;/protocol&gt;
          &lt;host&gt;192.168.1.2&lt;/host&gt;
          &lt;port&gt;3128&lt;/port&gt;
          &lt;nonProxyHosts&gt;localhost&lt;/nonProxyHosts&gt;
      &lt;/proxy&gt;
  &lt;/proxies&gt;
  </code></pre>
  
  <p>Is it possible to configure a proxy for both <code>HTTP</code> and <code>HTTPS</code> in maven's <code>settings.xml</code>?  I'm aware that I could workaround this by passing Java system properties to the maven invocation such as:</p>
  
  <pre><code>-Dhttps.proxyHost=192.168.1.2 -Dhttps.proxyPort=3128
  </code></pre>
  
  <p>but surely this must be possible from within <code>settings.xml</code>?</p>
  
  <p>Maven bugs raised such as <a href="https://issues.apache.org/jira/browse/MNG-2305" rel="noreferrer">MNG-2305</a> and <a href="https://issues.apache.org/jira/browse/MNG-4394" rel="noreferrer">MNG-4394</a> suggest this issue is resolved, but I am not convinced.</p>
  
  <p>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 <code>settings.xml</code> for Maven to direct both types of traffic.</p>