AzureDevOps - SonarCloudAnalyze Issue- ##[error]java.lang.IllegalStateException: Unable to load comp

We at ‘One America’ have successfully integrated the ‘Sonar Cloud’ code scans for few projects during the Azure DevOps Builds.

However, since few days we are suddenly facing issues for all the projects that have integrated the ‘Sonar Cloud’ code scans in Azure DevOps. The ‘SonarCloudAnalyze’ task has been failing with the error message (attached in this email) even though we have changed nothing in the configuration.
<
- task: SonarCloudPrepare@1
inputs:
SonarCloud: ‘SonarCloud’
organization: ‘oneamerica’
scannerMode: ‘CLI’
configMode: ‘manual’
cliProjectKey: ‘oneamerica_eAccessPrj’
cliProjectName: ‘eAccessPrj’
cliSources: ‘.\eaccessWeb\JavaSource\com’
extraProperties: |
sonar.java.binaries=eaccessWeb\JavaSource\com\oneamerica\eaccess*,eaccessWeb\JavaSource\com\oneamerica\eaccess**
sonar.projectVersion=$(Build.BuildNumber)
/>
<

  • task: SonarCloudAnalyze@1
    displayName: ‘Run SonarCloud code analysis’

SonarCloudAnalyzeIssue.txt (46.7 KB)

Hey there.

It looks like you’re analyzing Java code but using the CLI Scanner – which we don’t recommend.

What build tool do you typically use to build your Java code? Maven/Gradle/Ant?

we are using Gradle build tool. Also what are the alternatives to use for java code other than the Scanner CLI ?

we are able to resolve the Issue. Please find the working yaml Task. I need some help from the community abot the SonarScanner Version Release Notes. It is a new Scanner version which broke our builds.

<
Code Snippet to be updated in Failing builds is this Build Tasks…One liner>

  • task: SonarCloudPrepare@1
    inputs:
    SonarCloud: ‘SonarCloud’
    organization: ‘oneamerica’
    scannerMode: ‘CLI’
    configMode: ‘manual’
    cliProjectKey: ‘oneamerica_eAccessPrj’
    cliProjectName: ‘eAccessPrj’
    cliSources: ‘.\eaccessWeb\JavaSource\com’
    extraProperties: |
    sonar.java.binaries=$(Build.SourcesDirectory)\eaccessWeb\JavaSource\com\oneamerica\eaccess
    sonar.projectVersion=$(Build.BuildNumber)

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