Maven错误“Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:create ”解决

用maven3新建一个项目时,输入的命令以下:apache

mvn archetype:create

出现错误以下:maven

[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.apache.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.<init>() -> [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

可能存在的缘由:好比Java HOME设置不正确,Maven HOME设置不正确,在Maven3使用Maven2的命令。spa

解决方法:插件

* JAVA_HOME没有设置或者设置有误、m2_home设置有误debug

* 删除/org/apache/maven/plugins/下的maven-archetype-plugincode

* archetype:create命令已通过期,须要使用 archetype:generate 来进行代替(方案可行)orm

* maven-archetype-plugin 2.3版本的插件有问题,换其它版本进行建立(方案可行)blog

最终我直接升级了命令,问题解决:it

mvn archetype:generate
相关文章
相关标签/搜索