George
George

Reputation: 2594

Maven Quickstart Archetype does not exist

I wanted to start a new project using maven. Installed Maven 3.3.9, put it in my path, created an empty folder and ran the command given in 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 got an error

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 DO I create a blank Maven project?

Upvotes: 13

Views: 19212

Answers (4)

Heena Patidar
Heena Patidar

Reputation: 41

I was getting a similar error while creating a new maven project for building a Java web application using Spring MVC framework in Eclipse IDE. Archetype repository not defined. Using the one from [org.apache.maven.archetypes:maven-archetype-quickstart:1.4] found in catalog remote and progressed 33% only.

by defining the archetype repository URL in Eclipse IDE I was able to resolve this issue.

here, are the steps I followed:

  1. In Eclipse IDE, go to "Window" -> "Preferences" to open the preferences dialog.
  2. In the preferences dialog, expand the "Maven" category and click on "Archetypes".
  3. Click on the "Add Remote Catalog" button.
  4. Enter a name for the catalog and provide the catalog file URL associated with the archetype repository. For example, you can try using the following URL for the archetype repository: Catalog File: https://repository.jboss.org/nexus/content/repositories/releases/archetype-catalog.xml
  5. Click "OK" to add the remote catalog and associate it with the archetype repository.
  6. Click "Apply" or "OK" to save the changes and close the preferences dialog.

Now while creating a new maven project it was asking for parent group id, artifact id, and version in I have given org.jboss.spring.archetypes, spring-mvc-webapp, 1.0.0.CR8 respectively

Upvotes: 1

Mick.zw
Mick.zw

Reputation: 21

Another reason for this, as was in my case, was to do with spelling mistakes, especially when you're new to this, a common misspelling would be archtype instead of archetype and this fixed the same error in my case.

Upvotes: 2

janos
janos

Reputation: 124656

Same thing happens for me. That's indeed a shame. The version 5-SNAPSHOT looks a bit strange. If you just drop that, it actually works:

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

You can also simply specify only groupId and artifactId in batch mode:

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

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

For more info, see this page: Maven in 5 Minutes.

Upvotes: 6

nandsito
nandsito

Reputation: 3852

The specified version is not valid. It's from a 2010-edited Maven example page.

The most recent archetype version 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

Upvotes: 11

Related Questions