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
If this warning is accompanied by the warning:
Received fatal alert: protocol_version
Then check your java version. I was able to solve this issue by upgrading my java version from 7 to 10. See the following:
https://github.com/technomancy/leiningen/issues/2364
Had same issue and the thing that worked for me was reinstalling java
sudo yum install java
Find the path where java is installed, you can use which java
or whereis java
or sudo find / -name javac
For me, it was /usr/lib/jvm/java-11-amazon-corretto.x86_64/bin
sudo vi ~/.bashrc
add below lines
export PATH=$PATH:/usr/lib/jvm/java-11-amazon-corretto.x86_64/bin
source .bashrc
and then try your command - mvn archetype:generate
.
Got the same issue with maven 3. I just upgraded from jdk7 to jdk8 and the issue was resolved
I had same problem. Root cause: typed mvn generate:archetype instead archetype:generate.
mvn archetype:generate - is correct way.
The other thing that could be going wrong is that your machine is behind a firewall or proxy so your box is not able to hit http://repo1.maven.org/maven2
. Try accessing this URL directly in a browser or something to test if you are able to make the request.
Since Apache Maven repository URL is updated from http://repo.maven.apache.org/maven2/ to https://repo.maven.apache.org/maven2/ in NetBeans 8.2 or lower version we are facing this issue.
So what's the solution?
Solution 1:- User Terminal to download an updated maven dependencies Check out this Guide on Maven.Apache.Org
Solution 2:- Update your NetBeans, Move to Apache NetBeans 11