Enable proxy setting for Maven in Eclipse IDE

While creating maven project, we many face issues during maven build, as maven tries to download dependency jars from a remote repository, and if there is a firewall and proxy set up, which may prevent maven from directly connecting to internet.

Latest eclipse IDE comes with maven build tool integrated and makes easier to create Maven projects using eclipse IDE. In this post, we will see how to set up proxy settings for maven on Eclipse IDE. Following are the steps to enable proxy settings.

  • Create a XML file name settings.xml and add the following content. Location of this file will be C:\Users\{User Name}\.m2\settings.xmlas eclipse will have default maven home set to C:\Users\{User Name}\.m2\ directory. copy your configuration file settings.xml to this directory. Set the proper proxy host, <username>, <password> and <nonProxyHosts> fields if required and save the file.
  • Navigate to Window > Preferences > Maven from eclipse toolbar. Under Maven preferences settings, select User Settings. Here, under User Settings, we need to add a settings.xml file location, which will contain the proxy settings details. Browse to the created settings.xml file and click on Update Settings button. Finally, click on OK. Now our Maven projects should use proxy settings to download the dependencies from the remote repository.


In this post we learned how to set proxy settings for Maven projects in eclipse IDE.

Note: Eclipse version: Eclipse Neon.

Also read: