Configuring a Proxy Server in Maven

Maven

To configure a proxy server in Maven 2 or Maven 3, edit the settings.xml file and configure the <proxies> section.

The settings.xml file is located at: ${userhome}/.m2/settings/xml.

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://maven.apache.org/SETTINGS/1.0.0
  http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <proxies>
    <proxy>
      <id>defaultProxy</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>default.proxy.server.host</host>
      <port>8080</port>
      <username>default.proxy.user</username>
      <password>secret</password>
      <nonproxyhosts>*.acme.com|*.acme.org</nonproxyhosts>
    </proxy>
  </proxies>
</settings>

Add a comment

Comments

This is useful
Written on Tue, 03 Mar 2015 16:00:03 by Steve