When packaging my project using maven in intellij idea, it gives below error, also my java compiler version is set on 1.8: diamond operator is not supported in -source 1.5 [ERROR] (use -source 7 or higher to enable diamond operator) I'm really confused, because both java version and compiler version are set with 1.8.