2 panbingcan272007258 panbingcan272007258 于 2016.09.15 09:29 提问

maven 执行指令创建项目是报错

尝试换了多个版本 同样的错误提示
指令 mvn archetype:create -DgroupId=com.test.maven -DartifactId=test1 -DpackageName=com.test.maven.test1
刚开始下载一些东西,一会就报这个错误
貌似是有一个插件找不到,求解

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:create (default-cli) on project standalone-pom: Unable to parse configuration of mojo org.apac
he.maven.plugins:maven-archetype-plugin:2.4:create for parameter #: Cannot create instance of interface org.apache.maven.artifact.repository.ArtifactRepository: 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

2个回答

weisg81
weisg81   2016.09.15 13:21
已采纳

可能是以下的原因导致的:
1、JAVA_HOME没有设置或者设置有误、m2_home设置有误
2、要删除/org/apache/maven/plugins/下的maven-archetype-plugin
3、archetype:create命令已经过期,需要使用 archetype:generate 来进行代替(方案可行)
4、maven-archetype-plugin 2.4版本的插件有问题,换其它版本进行创建(方案可行)

whjianwang
whjianwang   2016.09.15 10:37
Csdn user default icon
上传中...
上传图片
插入图片