[bug] maven“1.5不支持diamond运算符,请使用source 7或更高版本以启用diamond运算符”

原因

  • maven打包默认采用jdk 1.5,无法识别<>

解决

在pom.xml中加入:

<properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
</properties>

参考

https://www.cnblogs.com/tongxuping/p/7257623.html

原文地址:https://www.cnblogs.com/cxc1357/p/13150033.html