Unable to load component class org.sonar.ce.task.projectanalysis.step.ExecuteVisitorsStep

In a pipeline script were using SonarQube to anayse a project like:

Jenkins Sonar version: SonarQube Scanner 7.0.2.4839
SonarQube server: sonarqube-25.4.0.105899
Java version in pipeline: Temurin 17

Problem: since ?? error: ERROR Issue exclusions are misconfigured. File pattern is mandatory for each entry of ‘sonar.issue.ignore.multicriteria’

When adding line like:

           -Dsonar.issue.ignore.multicriteria=a1 \
           -Dsonar.issue.ignore.multicriteria.a1.ruleKey=java:S1698 \
           -Dsonar.issue.ignore.multicriteria.a1.resourceKey=src/test/java/**/*.java \

The scan works fine but then the error comes from server:

{"task":{"id":"44f2e6e6-00a5-4417-8941-4df00bb6a2b5","type":"REPORT","componentId":"AZPUOejvIA4AhlyPXcju","componentKey":"inproces","componentName":"inproces","componentQualifier":"TRK","status":"FAILED","submittedAt":"2025-04-08T14:58:42+0200","submitterLogin":"XX@XX.nl","startedAt":"2025-04-08T14:58:44+0200","executedAt":"2025-04-08T14:58:51+0200","executionTimeMs":6837,"errorMessage":"Unable to load component class org.sonar.ce.task.projectanalysis.step.ExecuteVisitorsStep","hasScannerContext":true,"warningCount":0,"warnings":[],"infoMessages":[]}}
 steps {
            withSonarQubeEnv(installationName: 'sonar')  {
            script {
                POM_VERSION = readMavenPom(file: "$PROJECT_FOLDER/pom.xml").getVersion()
            }

            echo "Version ${POM_VERSION}"
            sh """POM_VERSION=${POM_VERSION} && $SCANNER_HOME/bin/sonar-scanner -Dsonar.organization=$ORGANIZATION \
               -Dsonar.working.directory=$WORKSPACE \
               -Dsonar.projectKey=$PROJECT_NAME \
               -Dsonar.projectName=inproces \
               -Dsonar.projectBaseDir=$PROJECT_FOLDER \
               -Dsonar.sources=src/main/java \
               -Dsonar.java.coveragePlugin=jacoco \
               -Dsonar.tests=src/test/java \
               -Dsonar.test.exclusions=src/test/java/**/*.java  \
               -Dsonar.exclusions=src/test/java/**/*.java  \
               -Dsonar.coverage.exclusions=src/test/java/**/*.java  \
               -Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml \
               -Dsonar.java.binaries=target/classes \
               -Dsonar.java.libraries=target/inproces/WEB-INF/lib \
               -Dsonar.issue.ignore.multicriteria=a1 \
               -Dsonar.issue.ignore.multicriteria.a1.ruleKey=java:S1698 \
               -Dsonar.issue.ignore.multicriteria.a1.resourceKey=src/test/java/**/*.java \
               -Dsonar.projectVersion=$POM_VERSION \
               -Dsonar.token=sqa_4737869bf893a8cf761a552d2c599525a124ac60"""
            }

I don’t think we’ve even announced this version yet :laughing: Thanks for being an early adopter.

I had no issues running the command you shared and having analysis pass – except I had to wrap your file paths in quotes

-Dsonar.issue.ignore.multicriteria.a1.resourceKey="src/test/java/**/*.java"

Still, not doing so just wouldn’t allow the command to run, but that could be something specific to macOS.

zsh: no matches found: -Dsonar.issue.ignore.multicriteria.a1.resourceKey=src/test/java/**/*.java

Could you give this a try?

Already found out the what the problem was:
mismatch between pipeline configuration and SonarQube server configuration:

Ignore Issues on Multiple Criteria: forgot the file path Pattern

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.