一、概述:

在使用mvn 命令mvn archetype:create -DgroupId=com.chuanliu.c11 -DartifactId=c11searcher在控制创建maven项目和pom项目时,没有创建成功,错误信息如下:

[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 3:  mojo org.apache.maven.plugins:maven-archetype-plugin:2.4: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

二、可能的原因有几个,比如Java HOME设置不正确,Maven HOME设置不正确,在Maven3使用Maven2的命令,具体为:

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

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

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

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

有了上述的解决方法,所以就对它们一一测试。

三、解决方案:

1、JAVA_HOME没有设置或者设置有误、m2_home设置有误

于是去查询mvn所依赖的版本和jdk版本,截图如下:

如果信息没问题,接着看后面的方案。

2、删除/org/apache/maven/plugins/下的maven-archetype-plugin

下图摘自网上:

按照图片上说的,删除了maven-archetype-plugin,重新执行命令,仍然报同样的错误,如下图所示:

于是继续使用后面的方案。

3、archetype:create命令已经过期,需要使用 archetype:generate 来进行代替

因为我当前使用的是maven3.3的版本,其实从控制台上的错误信息也可看出,报错的是2.4的信息,所以也可猜测出是版本引起来的。经查文档可看出需要使用generate代替create,即将

mvn archetype:generate -DgroupId=com.chuanliu.c11 -DartifactId=c11searcher

代替之前的

mvn archetype:create -DgroupId=com.chuanliu.c11 -DartifactId=c11searcher

4、maven-archetype-plugin 2.4版本的插件有问题,换其它版本进行创建

于是采用以下指令进行尝试,发现可以生成:

mvn org.apache.maven.plugins:maven-archetype-plugin:2.2:create  -DgroupId=com.chuanliu.c11 -DartifactId=c11searcher

以上几种方案可能在不同的环境下会有不同可行性,在我本机测试方案3和方案4是可行的。如有朋友有其它解决方案,可以跟我留言。关于create命令就讲到这里。maven在3.0.5及以上就建议采用genrate命令了,建议大家尽量采用genrate代替create命令。


Maven创建项目: Failed to execute goal org.apache.maven.plugin( mvn archetype:create)的更多相关文章

  1. 使用idea maven打包项目 Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:resources

    超级折磨人 在网上搜到的解决方案: 技术交流群 : 816227112 修改 和 <plugin> <groupId>org.apache.maven.plugins</ ...

  2. Maven 错误:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project appservice-common: Fatal error compiling: 无效的目标发行版: 1.8

    通过IDEA 提供的面板 执行package 或者 install 没有错误,但是cmd terminal 窗口就不行!出现: Maven 错误:Failed to execute goal org. ...

  3. maven 编译出错 Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean

    eclipse在使用maven的tomcat控件编译java程序时,报错 Failed to execute goal org.apache.maven.plugins:maven-clean-plu ...

  4. Maven打包时报Failed to execute goal org.apache.maven.plugins:maven-war-plugin:解决方案

    问题现象: 用Maven打包时,报Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war错误. 原因分析: 打 ...

  5. maven bug之Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project acSpaceCommon: Fatal error compiling: tools.jar not found: C:\Program Files\J

    maven打包项目的时候一直报这个异常  一般的解决办法我都试过 在pom.xml加代码 也不行  只有10分了  求大神解答 这是因为测试代码时遇到错误,它会停止编译.只需要在pom.xml的< ...

  6. Maven打包异常:Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war

    出现下面异常,因为默认web.xml在  src/main/webapp  下所以才出现找不到的异常. 我的项目结构为 解决办法①:  在pom.xml里面制定 web位置即可 //先确保打包方式为w ...

  7. 解决maven项目 maven install失败 错误 Failed to execute goal org.apache.maven.plugins

    1.Maven构建失败 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin: 2.3.4 :compile ( ...

  8. maven build时报错Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test

    [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ ...

  9. 解决Failed to execute goal org.apache.maven.plugins

    1.Maven构建失败 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin: 2.3 . 2 :compile  ...

  10. Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile 解决办法

    Maven install失败 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (d ...

随机推荐

  1. ubutu下的几个命令

    nginx重启命令 (ps:意为将nginx重启) /usr/local/nginx/sbin/nginx -s reload 给new目录权限设置为777 (ps:意思为将wwwroot/new目录 ...

  2. 调色板QPalette类用法详解(附实例、源码)(很清楚:窗口背景色 前景色 按钮的颜色 按钮文本的颜色 )

    http://blog.csdn.net/rl529014/article/details/51589096

  3. sed(查找替换) 与awk(提取字段)

    通常: sed 处理列  awk处理行 比较方便 Sed是一个基本的查找替换程序     sed -i   "s/^@//g"     文件  #原地操作原文件,进行替换 cat ...

  4. Linux软件安装包中devel与非devel包之间的区别

    带devel(develop)的包,俗称开发包.功能上与普通包相同,但体积更大使用rpm -qi看看这两类包的区别: # rpm -qi glibc-devel-2.12-1.149.el6.x86_ ...

  5. MFC自绘控件学习总结

    前言:从这学期开始就一直在学习自绘控件(mfc),目标是做出一款播放器界面,主要是为了打好基础,因为我基础实在是很烂....说说我自己心得体会以及自绘控件的方法吧,算是吐槽吧,说的不对和不全的地方,或 ...

  6. python利用utf-8编码判断中文英文字符(转)

    下面这个小工具包含了判断unicode是否是汉字.数字.英文或者其他字符,全角符号转半角符号,unicode字符串归一化等工作. #!/usr/bin/env python # -*- coding: ...

  7. xpage 获取 附件

    var db:NotesDatabase=session.getCurrentDatabase(); var doc:NotesDocument=db.getDocumentByUNID('80E21 ...

  8. 【cocos2d-x】Win7下配置Cocos2d-x开发环境

    一.下载安装包 先去Cocos2d-x官网下载安装包,最新版本为cocos2d-2.1.5 http://www.cocos2d-x.org/news/134 二.解压安装包 下载完成后,解压文件,解 ...

  9. openstack之网络基础

    L1:物理层L2:数据链路层,基于mac地址的通信,通过交换机连接:对等传输,即交换机上的一个主机发一个包,连接在该交换机上的所有机器都能收到:L3:网络层,基于ip地址,路由器设备,连接不同网段,进 ...

  10. MD5校验及其c实现

    那么MD5校验是什么? 一般软件或者说文件都有自己的固定文件格式或者架构信息,说简单一点就是.”世界上没有完全相同的2片叶子” ,因为MD5是一种不可逆的加密算法. 那么对于某些网上公开下载的软件,视 ...