Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven Proxy settings.xml ignored

Tags:

maven-2

proxy

Maybe someone can help me with the following Problem:

I have declared a proxy in M as described at maven - Configuring a proxy.

For some reason the proxy is ignored, although the proxy itself works correctly with maven when setting the proxy via command line.

When calling the maven goal like this, it works:

mvn -DproxySet=true -DproxyHost=myproxy.com -DproxyPort=3128 eclipse:eclipse

Any suggestions for this problem?

like image 932
Grolsch Avatar asked Jan 28 '11 13:01

Grolsch


People also ask

What is nonProxyHosts in settings XML?

The nonProxyHosts setting accepts wild cards, and each host not to proxy is separated by the | character. This matches the JDK configuration equivalent. Please note that currently NTLM proxies are not supported as they have not been tested.

Is settings XML mandatory for Maven?

settings. xml is not required (and thus not autocreated in ~/. m2 folder) unless you want to change the default settings. Standalone maven and the maven in eclipse will use the same local repository (~/.

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.


1 Answers

When settings.xml is ignored, I tend to check first if the environment variable M2_HOME:

  • exists in the current shell session
  • refers to the parent directory of said settings.xml

mglauche comments:

M2_HOME should specify the system settings.xml to use.
You still have your user settings in ${home}/.m2/settings.xml, which should overwrite anything in the system settings.


For Maven Eclipse, as mglauche mentions in the comments, specify the full path in the maven preferences:

eclipse maven preferences

like image 125
VonC Avatar answered Sep 19 '22 12:09

VonC