解决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项目,错误就不见了。
成功创建
欢迎留言交流~~~