项目需要学了一下Maven,在网上翻了一个教程就开始安装,装完之后新建一个工程就出错了, 整个人都懵逼了。
命令:mvn archetype:create -DgroupId=com.rv.build -DartifactId=rvbuild 错误: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]
最后查了一下,把 create 改成 generate 就可以了,出现什么要选择 一路回车就好了。 不过还是没懂为啥create下载文件仓库就出错。
CMD创建工程的时候还卡在Generating project in Interactive mode不动了
解决方法是加个参数 -DarchetypeCatalog=internal 让它不要从远程服务器上取catalog:
mvn archetype:generate -DarchetypeCatalog=internal -DgroupId=com.rv.buildnew -DartifactId=rbuildnew -DarchetypeArtifactId=maven-archetype-webapp