10

Running on Windows XP, I set up my ~/.m2/settings.xml to include 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 worked great, downloading all the required files and succeeding.

But then I tried

mvn compile

and got:

Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (http.//repo.maven.apache.org/maven2): Error transferring file: 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 from 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'}

Huh ?! Why does it say userName='null' when I have specified a username and password in my settings.xml ?

I then tried:

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

and it made no difference - it still said userName='null'

How can I fix this thanks ?

n.b. stackoverflow forced me to change the "http:" in the error message to "http."

user2636310
  • 101
  • 1
  • 5

2 Answers2

0

Same here, using parameters on the cmd line or in the settings file.

fewe
  • 103
  • 3
  • 9
0

There are few things you need to check!

  1. if you are using IDE then you might be facing issues with Embedded maven installation which is by default value and you can get it resolved by changing maven installation. try this answer.

  2. if you are behind NTLM windows proxy you need to use CNTLM software to get you authenticated which is batter described in this answer.if you are using IDE please change installation as described in first point.

Community
  • 1
  • 1
positivecrux
  • 1,307
  • 2
  • 16
  • 35