0
votes

Java-Version Configuration

Java-Version used for compiling classes with ant: 1.8

pom.xml für Sonarqube-Analysis defines:

    <plugins>
       <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <configuration>
              <source>1.8</source>
              <target>1.8</target>

and

<!-- Set the sonar.java.source property to tell PMD which version of Java your source code complies to. The default value is 1.5. -->
<sonar.java.source>1.8</sonar.java.source>

Sonarqube-Version: 4.5.4

Sonarqube-PMD-Plugin-Version: 2.4.1

JDK configured in Jenkins-Job: 1.8

Sonarqube-Server runs using Java 8

There is only Java8 installed on both Jenkins- and Sonarqube-Server.

Jenkins executes the following maven-comand to start the analysis:

mvn.bat -f "D:\Jenkins\workspace\DVLP MW2.0 Coverage und Codeanalyse\sonar-pom.xml" -e -B sonar:sonar -Dsonar.jdbc.driver=com.mysql.jdbc.Driver "-Dsonar.jdbc.url=jdbc:mysql://192.168.58.121:3306/sonar?autoReconnect=true&useUnicode=true&characterEncoding=utf8" -Dsonar.host.url=http://192.168.58.121/sonar

What are we missing?

1
Please add information how you execute analysis (executed command, SonarQube runner or Maven plugin etc.). Maybe you execute analysis with JDK 7?agabrys
I added the information. There is definitely only Java8 installed on both Server Jenkins and Sonarqube.TimStefanHauschildt
The attached image is not available anymore...user1127860

1 Answers

1
votes

You should remove property sonar.java.source. SonarQube gets Java Class Version from maven-compiler-plugin configuration. It is not a problem if you compile with JDK7 and run analysis with JDK8 (or do both actions with JDK7/JDK8).