O'Reilly logo

Apache Maven Cookbook by Raghuram Bharathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Running Maven behind an HTTP proxy server

Most organizations do not allow devices in their network to access the Internet directly for security and other reasons. In such cases, typically, a proxy server comes into picture. The proxy server details are specified in the browser or any other location where access to the Internet is required.

How to do it...

Let's start running Maven behind an HTTP proxy server, by performing the following steps:

  1. Create a settings.xml file in the .m2 folder in your HOME directory, if it does not exist already.
  2. Add the following code within the settings tag:
     <proxies> <proxy> <id>myproxy</id> <active>true</active> <protocol>http</protocol> <host>proxy.myorg.com</host> <port>8080</port> <username>proxyuser</username> <password>somepassword</password> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required