本文主要是介绍Idea下Maven开发webapp时候,出现无法解析Maven-archetype-plugin情况,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
用Idea下Maven开发webapp时候,出现无法解析Maven-archetype-plugin情况,控制台出现如下代码。
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.030 s
[INFO] Finished at: 2017-07-07T08:53:53+08:00
[INFO] Final Memory: 7M/106M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-archetype-plugin:RELEASE or one of its
dependencies could not be resolved: Failed to read artifact descriptor for
org.apache.maven.plugins:maven-archetype-plugin:jar:RELEASE: Failed to resolve version for
org.apache.maven.plugins:maven-archetype-plugin:jar:RELEASE: Could not find metadata
org.apache.maven.plugins:maven-archetype-plugin/maven-metadata.xml in local
(/home/cloud/.m2/repository) -> [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/PluginResolutionException
[ERROR] Maven execution terminated abnormally (exit code 1)
很多人在看到报错后没有认真的看到报错信息的结尾,我也是,以为就是无法解析Maven-archetype-plugin,百度说的有几种情况
1.maven和jdk版本不对(新手刚建项目容易出现这种问题,以前建成功过项目的,一般不会出现这种问题)
2.本地中的plugin不可用(可能是第一次下载没下载成功,没下载完全导致的。所以解决办法就是先删除本地下载失败的插件, 然后重新build)
3.是因为没有配置镜像(maven默认仓库在国外,下载速度慢,有的还下载不下来,所以需要在setting.xml文件中配置镜像.这里用 的是阿里云镜像)
<mirrors><!-- mirror| Specifies a repository mirror site to use instead of a given repository. The repository that| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.|<mirror><id>mirrorId</id><mirrorOf>repositoryId</mirrorOf><name>Human Readable Name for this Mirror.</name><url>http://my.repository.com/repo/path</url></mirror>--><mirror><id>alimaven</id><name>aliyun maven</name><url>http://maven.aliyun.com/nexus/content/groups/public/</url><mirrorOf>central</mirrorOf> </mirror></mirrors>
我的是没有配置镜像,所以配置好镜像就好了
这篇关于Idea下Maven开发webapp时候,出现无法解析Maven-archetype-plugin情况的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!