关于Maven执行mvn help:system命令报错

关于mvn help:system 命令报错 设置阿里云仓库无效?

记录一下关于Maven安装之后mvn help:system命令执行报错的坑
	因为一些原因Maven重新安装之后执行 mvn help:system 一直报错,网上搜了很多教程,终于找到了解决方法
	在这里把解决方法分享给大家

Maven 报错log

mvn help:system
[INFO] Scanning for projects...
Downloading from alimaven: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.5: 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
Downloading from alimaven: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-install-plugin:2.4: Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.4
Downloading from alimaven: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-deploy-plugin:2.7: Plugin org.apache.maven.plugins:maven-deploy-plugin:2.7 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-deploy-plugin:jar:2.7
Downloading from alimaven: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-site-plugin/3.3/maven-site-plugin-3.3.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-site-plugin:3.3: Plugin org.apache.maven.plugins:maven-site-plugin:3.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-site-plugin:jar:3.3
Downloading from alimaven: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-antrun-plugin/1.3/maven-antrun-plugin-1.3.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-antrun-plugin:1.3: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-antrun-plugin:jar:1.3
Downloading from alimaven: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-assembly-plugin/2.2-beta-5/maven-assembly-plugin-2.2-beta-5.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5: Plugin org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-assembly-plugin:jar:2.2-beta-5
Downloading from alimaven: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-dependency-plugin/2.8/maven-dependency-plugin-2.8.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-dependency-plugin:2.8: Plugin org.apache.maven.plugins:maven-dependency-plugin:2.8 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-dependency-plugin:jar:2.8
Downloading from alimaven: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-release-plugin/2.5.3/maven-release-plugin-2.5.3.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-release-plugin:2.5.3: Plugin org.apache.maven.plugins:maven-release-plugin:2.5.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-release-plugin:jar:2.5.3
Downloading from alimaven: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/mojo/maven-metadata.xml
Downloading from alimaven: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to alimaven (http://maven.aliyun.com/nexus/content/repositories/central/): transfer failed for http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-metadata.xml
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to alimaven (http://maven.aliyun.com/nexus/content/repositories/central/): transfer failed for http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/mojo/maven-metadata.xml
[WARNING] org.apache.maven.plugins/maven-metadata.xmlfailed to transfer from http://maven.aliyun.com/nexus/content/repositories/central/ during a previous attempt. This failure was cached in the local repository and resolution will not be reattempted until the update interval of alimaven has elapsed or updates are forced. Original error: Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to alimaven (http://maven.aliyun.com/nexus/content/repositories/central/): transfer failed for http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-metadata.xml
[WARNING] org.codehaus.mojo/maven-metadata.xmlfailed to transfer from http://maven.aliyun.com/nexus/content/repositories/central/ during a previous attempt. This failure was cached in the local repository and resolution will not be reattempted until the update interval of alimaven has elapsed or updates are forced. Original error: Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to alimaven (http://maven.aliyun.com/nexus/content/repositories/central/): transfer failed for http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/mojo/maven-metadata.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.617 s
[INFO] Finished at: 2022-09-06T19:47:00+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'help' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (D:\.m2\repository), alimaven (http://maven.aliyun.com/nexus/content/repositories/central/)] -> [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/NoPluginFoundForPrefixException

控制台解决方案

	一开始遇见这个问题的时候确实以为是网络或者仓库问题,但是在网上看了很多教程,设置了各种仓库源,统统的是无
效的,甚至一度绝望,但是经过深入折腾之后,发现不是仓库的问题,是Maven下载依赖的时候网站SSL证书的问题

	知道原因之后剩下的就很好解决了,根据具体原因网上搜索问题发现简直太好解决了,下面就来说说我是怎么解决的

执行 mvn help:system 的时候使用以下命令

mvn help:system -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true

上面这段代码的具体作用就是 强制忽略所有证书检查
然后命令行执行就没有问题啦
在这里插入图片描述

IDEA解决方案

打开IDEA的设置(菜单点击:file->settings)
在这里插入图片描述
这个时候我们的IDEA就能正常下载Maven的依赖了
如果担心执行的时候也会有这种问题可以在Runner里面也设置上这段命令
在这里插入图片描述
点击OK就可以开心的使用Maven了

  • 6
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值