How to configure proxy in Maven?

  1. The default location for the settings file is ~/.m2/settings.xml.
  2. Please make sure your settings.xml is secured with permissions appropriate for your operating system.
  3. <settings>
    ..
    <proxies>
    <proxy>
    <active>true</active>
    <protocol>http</protocol>
    <host>locaproxy.com</host>
    <port>888</port>
    <username>username</username>
    <password>yourpassword</password>
    <nonProxyHosts>www.website1.com|*.website2.com</nonProxyHosts>
    </proxy>
    </proxies>
    ..
    </settings>