Maven创建项目: Failed to execute goal org.apache.maven.plugin( mvn archetype:create)
一、概述:
在使用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)的更多相关文章
- 使用idea maven打包项目 Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:resources
超级折磨人 在网上搜到的解决方案: 技术交流群 : 816227112 修改 和 <plugin> <groupId>org.apache.maven.plugins</ ...
- 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. ...
- 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 ...
- 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错误. 原因分析: 打 ...
- 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的< ...
- Maven打包异常:Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war
出现下面异常,因为默认web.xml在 src/main/webapp 下所以才出现找不到的异常. 我的项目结构为 解决办法①: 在pom.xml里面制定 web位置即可 //先确保打包方式为w ...
- 解决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 ( ...
- maven build时报错Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
[INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ ...
- 解决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 ...
- 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 ...
随机推荐
- Android平台APK分析工具包androguard的部署使用和原理分析
原创文章,转载请注明出处,谢谢. Android应用程序分析主要有静态分析和动态分析两种,常见的静态分析工具是Apktool.dex2jar以及jdgui.今天突然主要到Google code上有个叫 ...
- ActionBarSherlock学习笔记 第一篇——部署
ActionBarSherlock学习笔记 第一篇--部署 ActionBarSherlock是JakeWharton编写的一个开源框架,使用这个框架,可以实现在所有的Android ...
- poj 3264 Balanced Lineup(线段树、RMQ)
题目链接: http://poj.org/problem?id=3264 思路分析: 典型的区间统计问题,要求求出某段区间中的极值,可以使用线段树求解. 在线段树结点中存储区间中的最小值与最大值:查询 ...
- LKD3
第三章 进程1. Unix操作系统的抽象:进程和文件2. 进程包括两个因素:可运行代码,和资源(打开的文件,挂起的信号,内核内部数据,处理器状态,地址空间)3. 线程是进程中活动的对象.4. 线程有独 ...
- hdu5115 Dire Wolf【区间dp】
转载请注明出处,谢谢:http://www.cnblogs.com/KirisameMarisa/p/4361169.html ---by 墨染之樱花 [题目链接]http://acm.hdu.e ...
- nvarchar and nchar
Same: 1.store unicode charactor. 2. A charactor is stroed with 2 bytes. Different. 1. nchar 会自动填充数据 ...
- Linq to sql介绍及增、删、改、查
LinQ是指集成化查询语言,通过映射将数据库内的表名变为C#的类名,将列名作为属性名,将表的关系作为类的成员对象.O--M--R O-Object对象 R-Relation关系 M-Mapping映射 ...
- Orchard 添加搜索栏
Orchard 提供索引和搜索的功能. 索引功能需要开启 Indexing 模块, 同时我们要开启Lucene 模块(做实际检索工作的东西). 然后还要开启Search模块(调用Lucene 查询然后 ...
- WebForm发布提示:无法加载或找不到oracle.dataaccess文件
出错提示: 在32位错做系统的开发机上引用了第三方插件(oracle的dataaccess)完成的项目,将发布的程序拷贝到64位的服务器上进行发布时提示无法加载或找不到dataaccess文件. 错误 ...
- 数据层使用DBHelper.dll来减少工作量
目前在需求确定了以后进行开发的步骤一般是这样的:建立数据表,建立model,构建数据操作层,最后在页面中进行调用.关于数据操作层,因为大量的操作都集中在增加.更新.删除等简易操作,而我之前的写法是每次 ...