问题描述
在执行命令 mvn compile 发生错误

D:\Github_NOTES\JavaWeb_Learning\02Java\JavaWeb\Code\Maven1>mvn clean
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.example:Maven1:jar:1.0-SNAPSHOT
[WARNING] 'dependencies.dependency.version' for junit:junit:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 14, column 22
[WARNING] 'dependencies.dependency.version' for junit:junit:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 20, column 22
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: junit:junit:jar -> duplicate declaration of version RELEASE @ line 17, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] -------------------------< org.example:Maven1 >-------------------------
[INFO] Building Maven1 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ Maven1 ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.326 s
[INFO] Finished at: 2020-07-18T21:39:15+08:00
[INFO] ------------------------------------------------------------------------ D:\Github_NOTES\JavaWeb_Learning\02Java\JavaWeb\Code\Maven1>mvn compile
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.example:Maven1:jar:1.0-SNAPSHOT
[WARNING] 'dependencies.dependency.version' for junit:junit:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 14, column 22
[WARNING] 'dependencies.dependency.version' for junit:junit:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 20, column 22
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: junit:junit:jar -> duplicate declaration of version RELEASE @ line 17, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] -------------------------< org.example:Maven1 >-------------------------
[INFO] Building Maven1 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Maven1 ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ Maven1 ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent!
[INFO] Compiling 1 source file to D:\Github_NOTES\JavaWeb_Learning\02Java\JavaWeb\Code\Maven1\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] 不再支持源选项 5。请使用 7 或更高版本。
[ERROR] 不再支持目标选项 5。请使用 7 或更高版本。
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.529 s
[INFO] Finished at: 2020-07-18T21:41:39+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Maven1: Compilation failure: Compilation failure:
[ERROR] 不再支持源选项 5。请使用 7 或更高版本。
[ERROR] 不再支持目标选项 5。请使用 7 或更高版本。
[ERROR] -> [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/MojoFailureException

解决方案
pom.xml文件中增加maven编译的jdk版本设置,maven.compiler.source和maven.compiler.target,另外java.version最好也加上

     <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

maven报错:不再支持源选项 5。请使用 6 或更高版本的更多相关文章

  1. idea maven package报错"不再支持源选项 5 请使用 6 或更高版本。不支持发行版本 5"

    解决办法: 1.确保java compile以及project和module的java字节码版本是所用的java版本:

  2. maven出现不再支持源选项 1.5。请使用 1.6 或更高版本

    maven出现不再支持源选项 1.5.请使用 1.6 或更高版本 学习了:http://blog.csdn.net/sosous/article/details/78312867 错误: [ERROR ...

  3. Maven [ERROR] 不再支持源选项 5,请使用 7 或更高版本的解决办法

    刚刚学Maven,当我点击test时 就出现了这两个错误: [ERROR] 不再支持源选项 5.请使用 7 或更高版本.[ERROR] 不再支持目标选项 5.请使用 7 或更高版本. 后来在看到这篇文 ...

  4. -source 1.5 中不支持泛型(请使用-source5或更高版本)

    Idea中maven--compile时报错     -source 1.5 中不支持泛型(请使用-source5或更高版本) 解决办法 在项目的pom.xml中,添加 <build> & ...

  5. Maven [ERROR] 不再支持源选项 5。请使用 6 或更高版本

    报错信息如下 解决办法一 在settings.xml文件中指定jdk版本 既可以修改全局的settings.xml文件(C:\Program Files\apache-maven-3.6.0\conf ...

  6. IDEA运行报错: Maven编译错误:不再支持源选项 5。请使用 6 或更高版本

    这里 记录下 这个问题的解决方案: 1:修改maven settings.xml 中的数据 这里的版本要对应现在使用的jdk版本 2:检查idea 配置 图中2块区域要一致 检查这块地方对应了自己的j ...

  7. 【坑】Maven [ERROR] 不再支持源选项 5。请使用 6 或更高版本

    在pom.xml文件中添加如下代码: 注意:jdk使用自己下载的版本,我的是13 <properties> <project.build.sourceEncoding>UTF- ...

  8. maven:不再支持源选项 5。请使用 6 或更高版本。

    解决办法: 在pom.xml中添加maven的配置 <maven.compiler.source>11</maven.compiler.source> <maven.co ...

  9. Error 不再支持源选项 5。请使用 6 或更高版本。

    解决方案:在项目pom.xml中指定JDK版本 我的jdk版本是11.0.2 所以写的是11 根据你自己的jdk版本写 1.7/1.8~~~~ <properties>元素时根元素< ...

  10. 错误:[ERROR] 不再支持源选项 5。请使用 6 或更高版本。 [ERROR] 不再支持目标选项 1.5。请使用 1.6 或更高版本。

    解决方案 pom.xml文件中增加maven编译的java.version jdk版本设置,以及maven.compiler.source 资源编译jdk版本设置和maven.compiler.tar ...

随机推荐

  1. ILLA Cloud: 调用 Hugging Face Inference Endpoints,开启大模型世界之门

    一个月前,我们 宣布了与 ILLA Cloud 与达成的合作,ILLA Cloud 正式支持集成 Hugging Face Hub 上的 AI 模型库和其他相关功能. 今天,我们为大家带来 ILLA ...

  2. day39:MySQL:查询操作之单表查询&多表查询&子查询

    目录 part1:单表查询 1.where条件的使用 2.group 子句 分组分类 3.having 数据在分类分组之后,进行二次数据过滤 4.order by 排序, 按照什么字段进行排序 5.l ...

  3. token验证

    token验证 什么是token?我相信很多开发者都或多或少听过基于 token 的用户鉴权和基于 session 的用户鉴权,而今天说的 token 验证就是第一种了.token 的意思是" ...

  4. 链式描述线性表(C++实现)

    在链式描述中,线性表的元素在内存中的存储位置是随机的,每个元素都有一个明确的指针或链指向下一个元素的位置 chain类 在此使用单向链表实现了线性表,其中最后一个节点的指针域为NULL,即它用单向链接 ...

  5. C# 如何设计一个好用的日志库?【架构篇】

    〇.前言 相信你在实际工作期间经常遇到或听到这样的说法:   "我现在加一下日志,等会儿你再操作下."   "只有在程序出问题以后才会知道打一个好的日志有多么重要.&qu ...

  6. 百度首页静态展示页面HTML+CSS

    一直觉得百度首页很复杂的,有那么多的东西,跟这个博主学习了之后,仿写了一下,样式好像很简单 只设置的一些组件的高度而已,不得不说,CSS真是个好东西呀 话不多说,直接上代码 <!DOCTYPE ...

  7. 飞行时间技术TOF

    文章目录 飞行时间技术TOF 一. 光速的测定 二. 各种TOF技术 直接脉冲TOF 脉冲间接TOF 连续波调制TOF(Continous Wave TOF) 三. TOF技术的应用 飞行时间技术TO ...

  8. 基于.Net开发的数据库导入导出的开源项目

    在项目开发过程中,我们经常碰到从数据库导入导出的需求,虽然这样的功能不是很复杂,但是往往我们都会碰到一些问题. 比如导入的Excel格式问题.Excetl中图片导入问题,导出的需求为了方便客户查看,会 ...

  9. Prometheus-Operator使用ServiceMonitor监控配置时遇坑与解决总结

    摘要 本文范围: Prometheus-Operator & kube-prometheus 安装:以及在解决使用ServiceMonitor时遇到的坑. Prometheus Operato ...

  10. C语言快速入门教程1快速入门 2指令 3条件选择

    快速入门 什么是C语言? C是一种编程语言,1972年由Dennis Ritchie在美国AT & T的贝尔实验室开发.C语言变得很流行,因为它很简单,很容易使用.今天经常听到的一个观点是-- ...