解决IDEA的Plugin org.apache.maven.plugins:maven-archetype-plugin:RELEASE or one of its dependencies cou

解决IDEA的[ERROR] Plugin org.apache.maven.plugins:maven-archetype-plugin:RELEASE or one of its dependencies could not be resolved问题

在使用IDEA(之前没用过)创建maven项目时,总是创建不成功,文件残缺,下面是错误提示。

[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 (D:\maven-repo) -> [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解压目录下的conf文件夹里的setting.xml,在其中添加如下

<localRepository>D:\maven-repo</localRepository>

这个是仓库的路径,地址自己来定。
在这里插入图片描述

	<mirror>
    <id>aliyunmaven</id>
    <mirrorOf>*</mirrorOf>
    <name>aliyun maven</name>
    <url>https://maven.aliyun.com/repository/public</url>
	</mirror>

阿里的镜像更新了所以用https了而不是http。
在这里插入图片描述
保存之后退出。

检查IDEA的default settings 全局默认设置(2019的是 Setting for New Projects)。
在这里插入图片描述
在这里插入图片描述
注意是 default settings,setting只是对当前项目进行设置。
点击Runner 在VIM Options位置添加(原理是:忽略了ssl证书的验证)

-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true

在这里插入图片描述
重启IDEA,新建maven项目,错误就不见了。
成功创建
在这里插入图片描述
欢迎留言交流~~~

  • 23
    点赞
  • 34
    收藏
    觉得还不错? 一键收藏
  • 11
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 11
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值