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?
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With