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."