Setting up proxy for Maven mojo doesn't work
Hello world,
I want to use proxy in my maven project (to make some builds faster, because when processing Docbook documentation, some DTDs are slow to fetch from some servers).
I have tried following ways how to do it:
1) set it up in Java:
$JAVA_HOME/bin/ControlPanel -> Network Settings
2) in ~/.m2/settings.xml in properties
Code:
<settings>
...
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>proxy.mydomain.com</host>
<port>3128</port>
<nonProxyHosts>*.mydomain.com</nonProxyHosts>
</proxy>
</proxies>
</settings>
3) in ~/.m2/settings.xml in a profile, that is activated by default in my projects
Code:
<profile>
...
<properties>
...
<http.proxyHost>proxy.myhost.com</http.proxyHost>
<http.proxyPort>3128</http.proxyPort>
</properties>
</profile>
4) in the pom.xml's properties
Code:
<properties>
...
<http.proxyHost>proxy.myhost.com</http.proxyHost>
<http.proxyPort>3128</http.proxyPort>
</properties>
5) environment variable http_proxy:
Code:
export http_proxy="http:--proxy.myhost.com:3128/"
(I'm using Linux, it works for other command line utilities; I replaced // by -- in the URL to circumvent URL posting restriction of this forum).
6) on the command line:
Code:
mvn some_profiles_and_goals -Dhttp.proxyHost=proxy.myhost.com
-Dhttp.proxyPort=3128
I have tried it with Maven 2.0.10 and 2.2.1 with the same result. Only the solution 6 works, but that's not what I want to use (I don't want to specify parameters every time I run maven).
Thanks,
Zdenek