maven常见错误

maven常见错误

当运行 mvn clean, mvn install, mvn help:system时,类似错误:

 Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:3.1: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:3.1 from/to central (https://repo.maven.apache.org/maven2): Received fatal alert: protocol_version -> [Help 1]
Error: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolve

分析:当前使用的本地中的plugin不可用。可能是第一次下载没下载成功,没下载完全导致的,**也有可能是仓库地址没有one of its dependencies
解决:

  1. 先删除本地下载失败的插件,然后重新build。
    删除自己修改的仓库的的插件目录下的所有文件,重新build
    如:C:\Software\maven\repo\org\apache\maven\plugins
    删除此目录下的所有文件,然后重新build,如:mvn clean
  2. 换个仓库地址
    http://repo1.maven.org/maven2 (这个仓库最全,推荐使用,但有一点慢)
    http://maven.apache.org/download.cgi
    http://mvnrepository.com/ (这个仓库速度最快,国内有镜像服务器)
[参考链接:安装maven所见错误No plugin found for prefix 'help' in the current project and in the plugin](https://blog.csdn.net/u010649669/article/details/52078614) 

Unsupported major .minor version 52.0

参考链接:Incompatibility:org.codehaus.plexus.exception.ComponentLookupException

分析:minor需要jdk8
解决:设置maven的jdk为8
1 硬:JAVA_HOME

2 软:修改pom.xml或者seting.xml
    参考链接:Maven配置JDK版本

    原文作者:TianchiLiu
    原文地址: https://www.cnblogs.com/TianchiLiu/p/9209488.html
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞