Recently I faced problem using maven under a proxy network and by little research, found this solution.
Temporary solution:
Add the following options along with your maven command
Permanent solution:
To add the proxy settings permanently, goto {M2_HOME}/conf/settings.xml and find the <proxies> section. Un-comment the required sections and configure accordingly.
To set proxy without password protection, change it as follows:
Temporary solution:
Add the following options along with your maven command
-DproxySet=true -DproxyHost=myproxy.com -DproxyPort=3128For example, to run "mvn package":
mvn -DproxySet=true -DproxyHost=my.proxy.host -DproxyPort=3128 package
Permanent solution:
To add the proxy settings permanently, goto {M2_HOME}/conf/settings.xml and find the <proxies> section. Un-comment the required sections and configure accordingly.
To set proxy without password protection, change it as follows:
<proxies>Change the words in italic format.
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<host>proxy.host.net</host>
<port>80</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
</proxies>
Comments
Post a Comment