I want to build a simple project using a existing archetype. But I can\'t run mvn archetype:generate
as it keeps telling me the following information
This is the issue with your firewall. To check if firewall is on:
Click Start-> click Run-> type wscui.cpl -> click OK. In Windows Security Center-> click Security If net work Network Firewall is "on" you need to set the proxy for maven.
Go to /conf -> open settings.xml with notepad uncomment proxy (if you don't remember proxy settings u can check in webbrowser u r using)
<proxies>
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username></username>
<password></password>
<host>www-proxy.us.oracle.com</host>
<port>80</port>
<nonProxyHosts></nonProxyHosts>
</proxy>
</proxies>
You can leave the username and pwd fields blank and set only host and port.
proxy settings in maven go to apache-maven-3.3.9\conf folder and find settings.xml open it in any text editor go to the block of code that looks like below
<proxies>
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
|
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>proxyuser</username>
<password>proxypass</password>
<host>proxy.host.net</host>
<port>80</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
-->
</proxies>
just after (proxies).
Now change according to your proxy settings In my case it looks like the following
<proxies>
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<host>authproxy.serc.iisc.ernet.in</host>
<port>3128</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
|
-->
</proxies>
Now try running mvn archetype:generate and it should run and download
Another problem with Windows (Vista ,Windows 7 onward) is that the command prompt should be running under Administrative privileges (Right click command prompt shortcut and choose "Run ad Administrator" if UAC is on), so simply run command prompt as Administrator before executing mvn archetype:generate.
I had faced this issue while creating vaadin 7 project under windows 7 using following command.
mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-application -DarchetypeVersion=7.1.8 -DgroupId=im.sma.testproject -DartifactId=testproject -Dversion=1.0 -Dpackaging=war
In my case the solution was just run mvn archtype:generate in Safe Mode under your user profile. After that I could run it in normal boot.
I have face the same problem when using maven 3.6.1 with jdk 1.7.40.
To solve this, i simply update my version of JDk to 1.8.241.
I hope this will help you.
I solved this problem disabling the antivirus for a few time while the project is create .