javaeclipse

not able to create maven archetype project


I'm trying to create a Maven archetype project, but I'm running into issues. Here's what I've done so far:

Installed Maven (version 3.5.6) and confirmed it works with mvn --version

Ran the command: mvn archetype:generate -DgroupId=com.mycompany -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

The error I'm getting is: [ERROR] [ERROR] Some problems were encountered while processing the POM: [ERROR] Non-resolvable parent POM for com.mycompany:my-app:1.0-SNAPSHOT: Could not find artifact org.apache.maven.archetypes:maven-archetype-quickstart:pom:1.4 in central (https://repo.maven.apache.org/maven2) and 'parent.relativePath' points at no local POM @ line 5, column 13

What I've tried:

Verified my internet connection

Cleared my local Maven repository and tried again

Tried different archetype IDs (like maven-archetype-webapp)

Added -DarchetypeVersion=1.4 to the command

Environment:

OS: [Your OS, e.g., Windows 10, macOS Monterey]

Java version: [e.g., openjdk 11.0.15]

Maven version: [e.g., 3.8.6]

Question: Why can't Maven resolve the archetype, and how can I successfully create a new Maven project from an archetype?


Solution

  • I faced this issue as well. In my case I checked the option for "run archetype generation interactively" during project creation - on the specify archetype parameters step.

    All you have to do is go the Console and type Y then hit enter.