I configured Maven 3.0.3 and tried to download a sample project using archetypes with this command:
mvn archetype:generate -DarchetypeGroupId=org.graniteds.
I had the same problem because I was using port 80 instead of 8080 in the settings.xml proxy configuration
If you created new settings.xml file instead of copy it from somewhere else, remember to put the tag inside :
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd"> <proxies> ..... </proxies> </settings>
In my case, it was not worknig even after passing the proxy credentails.
Mistake was - forgot to remove the comment line.
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>345325</username>
<password>dfgasdfg</password>
<host>proxy.abc.com</host>
<port>8080</port>
<nonProxyHosts>proxy.abc.com</nonProxyHosts>
</proxy>
|--> ----------REMOVE THIS LINE AND CLOSE It above <proxy> tag
In my case, even my system is not behind proxy, I got same issue. I was able to resolve by typing mvn help:archetype before mvn archetype:generate
I have to put
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<host>Your proxy host</host>
<port>proxy host ip</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
Before
<proxy>
<id>optional</id>
<active>true</active>
<protocol>https</protocol>
<host>Your proxy host</host>
<port>proxy host ip</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
Weird, but yes!, <protocol>http</protocol>
has to come before <protocol>https</protocol>
.
It solved my problem. Hope it helps someone who faces connections issue even after enabling proxy settings in conf/settings.xml
.
I was having exactly the same problem.I went to my IE setting->LAN Settings.Then copied the Address as host and port as the port and it worked. Following is the snapshot of the proxies tag in the Settings.xml that I changed.
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<!--username>proxyuser</username>
<password>proxypass</password-->
<host>webtitan</host>
<port>8881</port>
<!--nonProxyHosts>local.net|some.host.com</nonProxyHosts-->
</proxy>