1. 程式人生 > >解決:mvn archetype:create Abstract class or interface 'org.apache.maven.artifact.repository.ArtifactRe

解決:mvn archetype:create Abstract class or interface 'org.apache.maven.artifact.repository.ArtifactRe

1 2 3 4 5 [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 paramete r #: Abstract class or interface
 'org.apache.maven.artifact.repository.ArtifactR epository' cannot be instantiated -> [Help 1]

在stackoverflow找到解決方式如下

1 mvn archetype:generate -DgroupId=org.sonatype.mavenbook.ch03 -DartifactId=simple -DpackageName=org.sonatype.mavenbook -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=
false

修改start命令為generate

原因分析:create is deprecated in maven 3.0.5 and beyond,在maven3.0.5以上版本捨棄了create,今後使用generate生成專案

CMD建立工程的時候還卡在Generating project in Interactive mode不動了 
解決方法是加個引數 -DarchetypeCatalog=internal 讓它不要從遠端伺服器上取catalog

出現要輸入選擇項 一路回車就好了。