永久解决maven项目Language Level为5的方法

一、前言

  在我们使用idea新建maven项目的时候,默认的Language Level为5,这极大的影响了我们编码的体验。那么有没有一种一劳永逸的方法呢,当然是有的。

二、操作步骤

  1、maven项目的默认pom.xml文件的配置,详细如下

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>junit5Demo</artifactId>
    <version>1.0-SNAPSHOT</version>

</project>

  2、查看maven工程的Language Level的值  

 结果:

   3、在pom.xml文件中增加配置

    <properties>
        <aspectj.version>1.8.10</aspectj.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

  保存,再刷新

   4、再查看Language Level的值

知道、想到、做到、得到
原文地址:https://www.cnblogs.com/Durant0420/p/14813838.html