Maven工程报Diamond types are not supported at language level '5’或Diamond types are not supported at this language level 的错误,只需要检查以下三个个地方即可:
已IDEA为例:
打开工程设置:
1.Project – Project language level:
2. Modules – Language level:
3.pom.xml
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>