Andrew Tobilko Andrew Tobilko - 1 month ago 18
Java Question

Why can't I create a Maven project?

mvn -version


mvn -version

mvn archetype:create \
> -DgroupId=com.tobilko \
> -DartifactId=site \
> -DarchetypeArtifactId=maven-archetype-webapp


I'm going to create a project with Maven using a
maven-archetype-webapp
archetype. Why can't I do it? I've just started learning Maven so the error doesn't tells me anything:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-
plugin:2.3:create (default-cli) on project standalone-pom: Unable to
parse configuration of mojo org.apache.maven.plugins:maven-archetype
plugin:2.3:create for parameter #: Abstract class or interface
'org.apache.maven.artifact.repository.ArtifactRepository' cannot be
instantiated: org.apache.maven.artifact.repository.ArtifactRepository.
<init>() -> [Help 1]


I don't want to have any other archetypes or a default archetype.

Answer

Dont use create use generate . Something like this

mvn archetype:generate 
 -DgroupId=com.tobilko 
 -DartifactId=site 
 -DarchetypeArtifactId=maven-archetype-webapp
Comments