- 在该Module下的pom.xml中,必须要为 maven.compiler 配置 target 和 source 版本
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
在创建模板 maven.webapp 项目的时候,习惯把 pom.xml 清理,但昨天遇到了这个问题
经查阅,好像是 jdk 和 maven 版本问题,具体也没深究,总之加入了配置后完全OK。
!加完配置别忘了刷新一下Maven,不然不生效