第一次创建Maven项目报错Could not transfer artifact org.apache.maven.pluginsmaven-clean-pluginpom

导读:本篇文章讲解 第一次创建Maven项目报错Could not transfer artifact org.apache.maven.pluginsmaven-clean-pluginpom,希望对大家有帮助,欢迎收藏,转发!站点地址:www.bmabk.com

第一次创建Maven项目失败
报错信息如下:

Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom

报错信息

  1. 很多人说是maven路径和仓库路径不一致,可我的明显是一致的
    maven配置

  2. 然后又找到说是镜像的问题,我打开报错信息的网址https://repo.maven.apache.org/maven2发现可以打开,镜像应该没问题,不过我还是抱着试一试的心态,在maven的conf目录下setting.xml文件添加了阿里云的镜像

    aliyunmaven * 阿里云公共仓库 https://maven.aliyun.com/repository/public

在这里插入图片描述
然后果然还是不行。问题依然存在。

  1. 爆大招了,先不管这报错,我来运行一下:
    在这里插入图片描述
    不出意料的ERROR,但是,还是让我发现了不一样的东西:

    [INFO] ————————————————————————
    [INFO] BUILD FAILURE
    [INFO] ————————————————————————
    [INFO] Total time: 1.917 s
    [INFO] Finished at: 2020-12-11T17:14:39+08:00
    [INFO] ————————————————————————
    [ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to aliyunmaven (https://maven.aliyun.com/repository/public): Transfer failed for https://maven.aliyun.com/repository/public/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [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

在这里插入图片描述
这是证书错误,访问https协议的网站,需要ssl认证才行,这里没有证书,我们可以用下面的方式忽略ssl检查导致的问题。

-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true

在这里插入图片描述
在下面这个地方也添加这行代码。

在这里插入图片描述

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

文章由半码博客整理,本文链接:https://www.bmabk.com/index.php/post/102150.html

(0)

相关推荐

半码博客——专业性很强的中文编程技术网站,欢迎收藏到浏览器,订阅我们!