一、概述:
在使用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命令。
相关推荐
Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project
idea创建Maven项目时,报错显示Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:resources,并且Maven插件内看不到 mybatis-generator。如下图: 折腾了好久发现配置放错地方了,...
主要介绍了Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1的解决办法的相关资料,需要的朋友可以参考下
在apache-maven-3.5.2/conf/setting.xml中加入以下配置即可解决 alimaven aliyun maven http://maven.aliyun.com/nexus/content/repositories/central/ central junit junit Address/ ...
org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject, org.apache.maven.archiver.MavenArchiveConfiguration) 解决方案: 第一种方式 war项目 <plugin> <groupId>org...
在<plugins></plugins>中添加<plugin> <groupId>org.apache.maven.plugins <artifactId>maven-compiler-plugin <version>3.8.1 <source>1.8 <target>1.8 </plugin>
spring-petclinic-master运行mvn install报错:Failed to execute goal io.spring.javaformat:spring-javaformat-maven-plugin:0.0.19:validate (default) on project spring-petclinic: Formatting violations ...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor (default -descriptor) on project maven-project: Error extracting plugin descriptor: ‘No mojo definitions wer...
Failed to execute goal org.apache.maven.plugins:maven-help-plugin:3.1.0:system (default-cli) on project standalone-pom: Execution default-cli of goal org.apache.maven.plugins:maven-help-plugin...
Failure to transfer org.codehaus.plexus:plexus-archiver:pom:1.0 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update ...
maven-surefire-plugin-2.22.1.jar
pit1 spring boot之 maven install 报错[Maven][ERROR] Failed to execute goal org.spri
commons-lang3.3.1.jar、Apache Commons包中的一个,包含了一些数据类型工具类,是java.lang.*的扩展。必须使用的jar包。为JRE5.0+的更好的版本所提供 Jar文件包含的类: META-INF/MANIFEST.MFMETA-INF/LICENSE....
jar包分享,你懂的 com.springsource.org.apache.commons.io-1.4.0.jar
thingsboard编译错误 Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.0:npm (npm install) on project js-executor: Failed to run task: 'npm install' failed. 该错误如果是3.0上的,请将...
Downloading from central: https://repo1.maven.org/maven2/org/apache/maven/plugins/maven-archetype-plugin/maven-metadata.xml 很奇怪,我的maven仓库配置了私有库,,并且在maven setting.xml中配置了mirror...
org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject, org.apache.maven.archiver.MavenArchiveConfiguration) 网上更新eclipse插件的网址都失效了找了好久才有个离线版 ...
hive 开发UDF 使用maven工程 引发jar包缺失 hive 开发UDF 使用maven工程 引发jar包缺失
maven-notice-plugin-1.0.1.jar
[INFO] ———————————————————————— [INFO] Reactor Summary for demo 0.0.1-SNAPSHOT: [INFO] [INFO] demo ……………………………………….. FAILURE [18:18 min] [INFO] admin-service ...