I have a maven-project, that is build with openjdk-11 and configures the source- and target-version only through the property maven.compiler.release.
Then I got the following error
Caused by: net.sourceforge.pmd.lang.java.ast.ParseException: Line 13, Column 88: Cannot use the diamond generic notation when running in JDK inferior to 1.7 mode!
The problem is that the sonar-maven-plugin only uses maven.compiler.source and maven.compiler.target and then falls back to java version 1.6 as the following outputs show
This tells me you have an error not with SonarQube, but with PMD – do you have the community-supportted jensgerdes/sonar-pmd plugin installed on your SonarQube instance?
What do you expect the value to be (what’s your target version)? Is it possible that sonar.java.source is being forced anywhere (a pom.xml file or build configuration?)