Configure network proxy settings for maven

Spread the words...Share on Google+3Share on Facebook0Tweet about this on Twitter2Share on LinkedIn2Buffer this pageShare on StumbleUpon0Share on Reddit0

By default, maven uses default network connection running on your local system. But, sometimes you are running your application in your workplace or company. These networks shields their intranet through proxy servers, so all internet queries made from your system goes through this proxy server.

Maven by default does not respect them, and to use maven in these restricted areas, you may need to configure network proxy settings for maven.

To setup proxy settings, follow below steps:

  • Navigate to path : C:Documents and Settings.m2
  • Open file settings.xml in edit mode in some text editor.
  • Open and update tag.

This tag will look like this:


<proxy>
        <id>optional</id>
        <active>true</active>
        <protocol>http</protocol>
        <username>proxyuser</username>
        <password>proxypass</password>
        <host>proxy.host.net</host>
        <port>80</port>
        <nonproxyhosts>local.net|some.host.com</nonproxyhosts>
</proxy>

Update above fields with your network specific credentials. They must be present in your browser’s connection settings. Use them here.

After above steps, you should be able to use maven behind proxy servers also.

Happy Learning !!

Spread the words...Share on Google+3Share on Facebook0Tweet about this on Twitter2Share on LinkedIn2Buffer this pageShare on StumbleUpon0Share on Reddit0

 

 

Give me your email address and whenever I write any tutorial or discuss any java concept, you will receive a little email in your inbox.

Join 2,879 other subscribers

Want to ask any question? Or suggest anything?