maven入门项目报错

来源:互联网 发布:如何看待辛亥革命 知乎 编辑:程序博客网 时间:2024/06/06 01:16

maven入门项目报错

2015-04-14 13:39130***@qq.com | 浏览 3203 次  悬赏:5
 编程语言软件开发
刚下载配置完maven,在命令行新建项目时报错:建项目的命令为:mvn archetype:create -DgroupId=org.sonatype.mavenbook.ch03 -DartifactId=simple -DpackageName=org.sonatype.mavenbook报错信息为:[INFO] Scanning for projects...[INFO] Building Maven Stub Project (No POM) 1[INFO] --- maven-archetype-plugin:2.3:create (default-cli) @ standalone-pom ---[INFO] BUILD FAILURE[INFO] Total time: 2.728 s[INFO] Finished at: 2015-04-14T13:36:35+08:00[INFO] Final Memory: 14M/108M[INFO] ------------------------------------------------------------------------[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 #: Cannot create instance of interface org.apache.maven.artifact.repository.ArtifactRepository -> [Help 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.[ERROR][ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginConfigurationException
  • 您的回答被采纳后将获得:
  • 系统奖励20(财富值+经验值)+难题奖励10(财富值+经验值)+提问者悬赏5(财富值+经验值)
我有更好的答案
按默认排序 | 按时间排序

3条回答

2015-10-16 10:53我的天呐123456 | 三级
【转】

在stackoverflow找到解决方式如下
mvn archetype:generate -DgroupId=org.sonatype.mavenbook.ch03 -DartifactId=simple -DpackageName=org.sonatype.mavenbook -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

修改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生成项目
评论 | 0 0
2015-04-15 18:31末流疯神 | 一级
我在网上看的,自己试过也行;

把你的建项目的命令为:mvn archetype:create -DgroupId=org.sonatype.mavenbook.ch03 -DartifactId=simple -DpackageName=org.sonatype.mavenbook中

archetype:create命令改成archetype:generate
就可以用了
评论(6) | 26 2
发布评论
2015-9-4 11:34wangduqiang722
原来如此 脑震荡的猪在maven3.0.5以上版本舍弃了create,使用generate生成项目回复
2015-7-28 11:24cyhbyw
解决了问题,非常感谢~~回复
2015-7-15 23:22腦震蕩的豬♂
在maven3.0.5以上版本舍弃了create,使用generate生成项目回复
2015-5-6 17:32韦美彤颜
明明archetype:create就可以直接创建,archetype:generate是分布操作,但是却可以运行成功,求大神解答一下回复
2015-4-24 16:36彭堃
感谢回复

12下一页>

2015-04-15 16:24zzy_19831106 | 二级 最快回答
我也遇到这个错误了 求解答
0 0
原创粉丝点击