Maven Quickstart Archetype does not exist

I wanted to start a new project using maven. Installed by Maven 3.3.9, put it in my path, created an empty folder and ran the command specified at https://maven.apache.org/archetypes/maven-archetype-quickstart/

mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=5-SNAPSHOT 

Instead of a new project, I received an error message

 E:\CODING\prj>mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=5-SNAPSHOT [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Maven Stub Project (No POM) 1 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] >>> maven-archetype-plugin:2.4:generate (default-cli) > generate-sources @ standalone-pom >>> [INFO] [INFO] <<< maven-archetype-plugin:2.4:generate (default-cli) < generate-sources @ standalone-pom <<< [INFO] [INFO] --- maven-archetype-plugin:2.4:generate (default-cli) @ standalone-pom --- [INFO] Generating project in Interactive mode [INFO] Archetype repository not defined. Using the one from [org.apache.maven.archetypes:maven-archetype-quickstart:1.1] found in catalog remote [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 5.016 s [INFO] Finished at: 2016-11-04T13:41:30-04:00 [INFO] Final Memory: 12M/114M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:generate (default-cli) on project standalone-pom: The desired archetype does not exist (org.apache.maven.archetypes:maven-archetype-quickstart:5-SNAPSHOT) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException 

Does anyone know why? Even better, how can I create an empty Maven project?

+6
source share
2 answers

The specified version is invalid. This is from the Maven example page published in 2010 .

The newest version of the archetype is 1.1 (ironically, also from 2010), so try this instead:

 mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.1 
+4
source

The same thing is happening to me. It's a shame. The 5-SNAPSHOT version looks a little strange. If you just drop this, it really works:

 mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart 

You can also just specify groupId and artifactId in batch mode:

 mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DinteractiveMode=false 

The result is almost identical to the creation with the maven-archetype-quickstart .

For more information, see this page: Maven in 5 minutes .

+5
source

Source: https://habr.com/ru/post/1012045/


All Articles