在cmd下,用mvn命令
mvn archetype:create -DgroupId=org.seckill -DartifactId=seckill -DarchetypeArtifactId=maven-archetype-webapp
新建web项目时出错。报错内容:
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 -> [Help 1]
原因是,我使用的maven版本是3.3.1,创建项目时create命令被generate替代了,使用下面新的命令就可以创建成功了:
mvn archetype:generate -DgroupId=org.seckill -DartifactId=seckill -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false