在idea中运行maven项目 如果出现idea warning:java源值已过时将在未来所有发行版中删除,详见如下截图所示:

注意:jdk8
要解决这个警告需要设置3个地方
-
首先打开File->Project Structure中的Project,将SDK和language level都设置一致,如下图所示:
-
仍然在Project Structure该窗口,点选选项卡Modules,选择Sources将language level都设置一致为8,如下图所示:
然后点【Apply】【OK】让以上配置生效。
-
最后在idea的菜单栏依次单击File->Settings...->Build,Executoion,Deployment->Compiler->Java Compiler中的Module Target bytecode version设置为8即可,如下图所示:
注意:Project bytecode version 下拉框这里也选8
然后点【Apply】【OK】让以上配置生效
然后再依次单击idea菜单项Build->Rebuild Project

如果仍然出现如下警告信息,

则单击idea菜单项File->Invalidate Caches/Restart...,清除缓存重启idea以上警告信息即彻底消除。

如果仍存在上述warning警告信息,pom.xml增加如下配置
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>