Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin: 3.2:sonar

Since the 3.2, the SonarQube maven plugin requires Java 8. You have to use the 3.0.2 version for Java 7.

You have to explicitely add this statement to your pom :

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>sonar-maven-plugin</artifactId>
    <version>3.0.2</version>
</plugin>

Because if you do not do so, by default this plugin uses the LATEST version of the plugin (3.2), hence your error.

See http://docs.sonarqube.org/display/HOME/Frequently+Asked+Questions#FrequentlyAskedQuestions-ShouldIlockversionofSonarQubeMavenplugininmypom.xml?


Regardless of what you compile your code with, the SonarQube analysis should be run with Java 8. You simply need to use different JDK versions for the compile and analysis. Either that, or do everything with Java 8 and -target 1.7.