Maven: 'org.apache.maven.artifact.repository.ArtifactRepository' cannot be instantiated

五柳-先生發表於2015-11-18
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 parameter #: Abstract class or interface 'org.apache.maven.artifact.repository.ArtifactRepository' cannot be instantiated -> [He
lp 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.

  

在stackoverflow找到解決方式如下

1
mvn archetype:generate -DgroupId=storm.blueprints -DartifactId=stormDemo -DinteractiveMode=false -DarchetypeCatalog=internal

修改start命令為generate

參考網址為http://stackoverflow.com/questions/29147329/unable-to-create-a-new-maven-hello-world-project

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

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

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

相關文章