How to configure Maven to use a proxy server

I am trying to configure Maven to use a proxy. It turns out to be a lot of work. Somewhere Maven read some proxy information that it continues to use.

I have already tried the following.

  • in terminal unset http_proxy

    andhttps_proxy

  • I didn't have it settings.xml

    . I added one and added proxy config to it with active

    isfalse

  • In settings.xml active = true

    andnonProxyHosts = *

  • I am removing proxy settings from /etc/environment

I don't want to set up a local proxy to make this work, is there any other way to tell Maven not to use a proxy.

+3


source to share


1 answer


The first step is to ask Maven to show you what configuration it sees / uses. Use the Help plugin for this: mvn help:effective-pom

shows you the complete POM that Maven will use and help:effective-settings

does the same for settings.xml

.

Now you can see if there are any proxy settings in these outputs to make sure the Maven universe is clean. I'm guessing someone is changing the global / default settings.xml

from conf

your Maven installation folder .



Then you need to check the proxy settings that Java is using. Check your environment and file$HOME/.mavenrc

+3


source







All Articles