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?
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?
Those who need to set these settings through the command line can use the following:
MAVEN_CLI_OPTS: "-DproxySet=true -Dhttp.proxyHost=yourProxyHost -Dhttp.proxyPort=9999 -Dhttp.nonProxyHosts=mvnrepository.com"
Usage:
mvn $MAVEN_CLI_OPTS test
Warning: nonProxyHosts property did not work correctly for me when using it from a CI environment. I suspect it might be because the pipe characters are not being interpreted correctly in Gitlab's YAML syntax but I didn't find a way to fix that.
Source: https://confluence.atlassian.com/jirakb/java-option-http-nonproxyhosts-does-not-work-214863640.html