问题描述
在执行命令 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. day32:进程&进程join&守护进程deamon

    目录 1.进程的基本概念 2.进程初体验 3.join:先子后主 4.守护进程:deamon 5.使用自定义类的方式创建进程 6.两张和进程相关的图 进程的基本概念 什么是进程? 进程就是正在运行的程 ...

  2. visio秘钥

    一.Visio2016专业版永久激活码: Visio 2016 Professional Retail零售版 [Key]:NKVJM-8MTT4-8YDFR-6738M-DPFJH [Key]:W9W ...

  3. YII文件上传

    <span style="font-size:14px;">use yii\web\UploadedFile; public function actionDoarta ...

  4. VUE3企业级项目基础框架搭建流程(3)

    VUE-Router npm install vue-router@4 安装完成后,在项目目录里新建一个router文件,我这里的用的是typeScript,所以建立的是router.ts, 该文件是 ...

  5. islider.js轮播图

    本篇文章地址:https://www.cnblogs.com/Thehorse/p/11601032.html css #iSlider-effect-wrapper { height: 220px; ...

  6. 【学习笔记】【题解】树形依赖 DP 选做

    地址:https://www.cnblogs.com/FReQuenter5156/p/shuxingyilaidp.html/ 简介 这类背包本质上是分组背包问题. 将一个节点的每一棵子树看作一组, ...

  7. cryptohack wp day(4)

    接上题 第五题(Modular Inverting) 在模运算中,如果我们要解决形如a * x ≡ b mod m的方程,其中a,b,m是已知整数,x是未知整数,我们可以使用扩展欧几里得算法来找到x的 ...

  8. 使用vite的创建vue项目

    首先也是打开项目文件目录 在标签处快速打上cmd即可打开cmd窗口 然后按照顶部图进行操作即可完成 安装完成的样子如下图 紧接着输入 npm run dev 将Local 的IP复制到浏览器打开,出现 ...

  9. PostgreSQL一站式插件推荐 -- pg_enterprise_views

    近日发现PG官方插件列表中新收录了一款插件 pg_enterprise_views,因为官方已经数年未添新的插件了很是新奇,找了台设备测试过后果断上了生产,得空分享给大家. 该插件提供了数十张系统表及 ...

  10. 树莓派上使用docker部署aria2,minidlna

    目前在树莓派上安装aria2跟minidlna能搜到的教程基本上都是直接apt-get install安装的.现在是docker的时代了,其实这2个东西可以直接使用docker run跑起来.有什么问 ...