[ACCEPTED]-SonarQube on Java8-project gives jacoco-Exception-java-8

Accepted answer
Score: 14

I got the missing info from the SonarQube 9 mailing-list... To summarize:

To get Java8 8 maven-build working on SonarQube-4.3:

  • Install 7 sonarqube-4.3, and start the server.

  • Login 6 to the web-gui => Settings => Update Center => Plugins Updates => Java => Click "Upgrade to 2.2.1"

Wait a minute or so for the upgrade 5 to complete... then shutdown+restart sonarqube. Go 4 back into the Upgrade Center and verify 3 you have plugin: Java 2.2.1

  • To get code-coverage in 2 Sonar, you now need to build with these 1 commands:

    mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install 
    mvn sonar:sonar
    

Reference: http://docs.codehaus.org/display/SONAR/JaCoCo+Plugin

That's it.

Score: 6

Here with java 11 I had this problem and 1 I fix adding this in my gradle properties:

jacoco {
  toolVersion = "0.8.4"
}
Score: 3

If you are running jacoco with gradle them 4 update the jacoco to latest version. I was 3 also facing the similar issues and it got 2 fixed after below changes

Java 11 and Gradle 1

jacoco {
    toolVersion = "0.8.4"
}
Score: 2

I was getting the same error when mvn building 4 a Java 1.7 project using JDK 1.8. The solution 3 was simple: I changed the jacoco plugin version to a newer version:

<plugin>
    <groupId>org.jacoco</groupId>
    <artifactId>jacoco-maven-plugin</artifactId>
    <version>0.7.6.201602180812</version>

(The 2 project was using version 0.6.3.201306030806 1 before.)

Score: 1

SonarQube 4.3 embeds Java plugin 2.1 whereas 3 http://jira.codehaus.org/browse/SONARJAVA-482 has been fixed in version 2.2. So by upgrading 2 the Java plugin to version 2.2.1, this should 1 fix your issue.

Score: 1

Setting $JAVA_HOME resolved the problem for me.

0

Score: 0

We had the same issue. What we did was re-install 9 sonarqube 4.3 with Java 8 already installed. Then 8 run analysis against sonar. If you already 7 have sonar/java 7 installed previously and 6 have ran analysis against it, sonar seems 5 to install some plugins which causes these 4 failures. If you re-install just sonar and 3 java 8 (dont remove mysql database etc... so 2 history is intact) - re run your analysis 1 it seems to solve the problem with the plugins.

Score: 0

I have done the following changes to come 8 out from the problem.I have used the two 7 steps for it , first one is that update 6 the jacoco in latest version along with its toolVersion , please 5 check it once below

    classpath "com.dicedmelon.gradle:jacoco-android:0.1.4"

And toolVersion is as follow

jacoco {
    toolVersion = "0.8.4"

}

Please 4 refer the link for more info Click here

And now check 3 the second step for it in which we use the 2 excludes = ['jdk.internal.*'] inside the testOption like below

 testOptions {
        unitTests.all {
            jacoco {
                includeNoLocationClasses = true
                excludes = ['jdk.internal.*']

            }
        }
    }

For more info in 1 it, please check the link Click here

More Related questions