zoukankan      html  css  js  c++  java
  • cmd中执行mvn help:system报错的解决办法

    错误信息:

    Downloading from repo1 Maven: https://repo1.maven.org/maven2/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 .....
    ..................
    [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 repos
    itories [local (D:mytoolsapache-maven-3.6.1
    epository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]

      

    mvn  -v 测试成功,运行mvn help:system报如上面错,这是因为没有相关jar包。

    解决方法1   可能是maven配置文件问题导致的:

       需要修改D:apache-maven-3.6.3conf下settings.xml文件。在<mirror></mirror>标签中增加如下配置:注意:是https!!是https!!是https!!  http是好久以前的地址了。

    <mirror>
          <id>repo1 Maven</id>
          <name>all repository mirror</name>
          <mirrorOf>*</mirrorOf>      
          <url>https://repo1.maven.org/maven2</url>
    </mirror>

     使用以上仓库配置可能会有ssl证书问题。参考本文方案4解决此问题。

    解决方法2:

         cmd中执行命令:mvn help:describe -Dplugin=help -e -X

    这个命令的执行后会出现一堆东西,也有报错信息,并且最后结可能是BUILD FAILURE,这些都不用管,只等它这个命令执行完之后,我们再去执行命令: mvn help:system ,然后就会成功了!

    此方案2原文:https://blog.csdn.net/qq_37537009/article/details/107714349

    解决方法3:

         windows操作系统权限问题导致的,可能是执行cmd权限不够或者是maven仓库所在文件夹权限不够。

    解决办法:执行cmd命令的时候使用管理员权限! 修改仓库地址到另外一个不需要管理员权限就能运行的盘符或者给仓库地址增加权限。


    解决方法4:

     在使用maven命令的时候 添加忽略SSL证书校验。

    maven命令  -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true
    例如:

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

     仔细看了下错误信息,发现走了弯路,这明显只是 [警告]无法检索的插件啊!!仓库地址在浏览器中可以访问,命令就是不行那就只能是https协议的ssl证书问题了。

    [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
    
    
    
    

     终于看到了想要的结果!!!

     

    如果你的问题解决了,劳烦点下推荐。 

    本人亲自解决过程此记录一下,以访重蹈覆辙。

  • 相关阅读:
    PHP里json_encode()与json_decod()区别
    数组进行排序
    tp5利用自带上传类实现单个文件与多文件上传
    mkdir() Permission denied 报错问题
    如何快速熟悉新项目的代码?
    Tp5自定义路径写入日志
    spring解决循环依赖
    spring注解的使用
    ssm的整合
    编程知识总结
  • 原文地址:https://www.cnblogs.com/chenghu/p/13915014.html
Copyright © 2011-2022 走看看