Maven 3.1.0 compiler does not use proxy username

Running on Windows XP, I installed my ~ / .m2 / settings.xml file to enable the following proxy settings:

<proxy> <id>optional</id> <active>true</active> <protocol>http</protocol> <username>davidho</username> <password>mypassword</password> <host>192.168.0.35</host> <port>3128</port> <nonProxyHosts>local.net|some.host.com</nonProxyHosts> </proxy> 

mvn archetype: generate, then do a great job by downloading all the necessary files and doing the following.

But then I tried

mvn compile

and received:

Plugin org.apache.maven.plugins: maven-resources-plugin: 2.6 or one of its dependencies cannot be resolved: Failed to read the artifact descriptor for org.apache.maven.plugins: maven-resources-plugin: jar: 2.6: Failed to transfer artifact org.apache.maven.plugins: maven-resources-plugin: pom: 2.6 from / to central (http.//repo.maven.apache.org/maven2): File transfer error: server returned HTTP response code : 407 for URL: http.//repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom with http.//repo .maven.apache.org / maven2 / org / apache / maven / plugins / maven-resources-plugin / 2.6 / maven-resources-plugin-2.6.pom with proxyInfo ProxyInfo {host = '192.168.0.35', userName = 'null ', port = 3128, type =' http ', nonProxyHosts =' null '}

A? Why does he say userName = 'null' when I specified the username and password in my settings.xml?

Then I tried:

mvn compile -Dhttp.proxyUser = davidho -Dhttp.proxyPassword = mypassword

and it didn't matter - it still said userName = 'null'

How can I fix this thanks?

nb stackoverflow made me change "http:" in the error message to "http."

+4
source share
2 answers

Here, using the parameters in the cmd line or in the settings file.

0
source

There are a few things you need to check out!

  • If you are using an IDE, you may run into problems with the Embedded maven installation, which is the default, and you can solve it by changing the maven installation. try this answer.

  • If you are behind an NTLM proxy, you need to use the CNTLM software to get the authentication that is the test described in this answer.if if you are using an IDE please change the setting as described in the first point.

0
source

Source: https://habr.com/ru/post/1494403/


All Articles