Maven Compilation Error: Use -source 7 or higher to enable diamond operator

This error happens only in Maven command line compile or in your IDE if you use new features of JDK that is not available outside 1.5. The reason is that MAVEN compiler default for source and target is 1.5 JDK version. Therefore, if you are getting the following error, you can fix it two ways.

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project StandardAppServices: Compilation failure
[ERROR] kafka/[43,71] diamond operator is not supported in -source 1.5
[ERROR] (use -source 7 or higher to enable diamond operator)
[ERROR] -> [Help 1]


  1. Fix using the build plugin
  2. <plugin>

  3. Fix using the Properties
  4. 	<properties>