Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make maven use system proxy settings

Tags:

maven-2

I'm using Ubuntu with Gnome where I can set network proxy settings (with authentication).

The question is: how I can run maven in command line and make it use this proxy?

like image 399
Timofey Gorshkov Avatar asked Aug 30 '10 14:08

Timofey Gorshkov


People also ask

Does Maven use system proxy?

By default, Maven will use the first active proxy definition it finds. Note that this is the protocol the proxy uses – the protocol of our requests (ftp://, http://, https://) is independent of this.

What is proxy settings in Maven?

You can configure a proxy to use for some or all of your HTTP requests with Maven. The username and password are only required if your proxy requires basic authentication (note that later releases may support storing your passwords in a secured keystore - in the mean time, please ensure your settings.


1 Answers

Did you take a look at http://maven.apache.org/guides/mini/guide-proxies.html?

In your settings.xml:

<settings>   .   .   <proxies>    <proxy>       <active>true</active>       <protocol>http</protocol>       <host>proxy.somewhere.com</host>       <port>8080</port>       <username>proxyuser</username>       <password>somepassword</password>       <nonProxyHosts>www.google.com|*.somewhere.com</nonProxyHosts>     </proxy>   </proxies>   .   . </settings> 

NOTE: This doesn't affect Java code! These proxy settings are Maven repository proxy settings.

like image 159
The Alchemist Avatar answered Sep 26 '22 10:09

The Alchemist