title: SonarQube fails on Azure Pipelines with Unable to load component class org.sonar.scanner.scan.filesystem.InputComponentStore
body: <p>After installing the marketplace plugin I'm following the <a href="https://docs.sonarqube.org/8.6/analysis/azuredevops-integration/" rel="nofollow noreferrer">official documentation for my SonarQube installation (8.6 Community)</a></p>
  <p>gradle plugin cfg:</p>
  <pre><code>plugins {
      id(&quot;org.springframework.boot&quot;) version &quot;2.4.2&quot;
      id(&quot;io.spring.dependency-management&quot;) version &quot;1.0.11.RELEASE&quot;
      id(&quot;org.sonarqube&quot;) version &quot;3.1.1&quot;
      kotlin(&quot;jvm&quot;) version &quot;1.4.21&quot;
      kotlin(&quot;plugin.spring&quot;) version &quot;1.4.21&quot;
  }
  </code></pre>
  <p>Here's a scerpt of the pipeline:</p>
  <pre><code>        - task: SonarQubePrepare@4
            inputs:
              SonarQube: 'profile-sonarqube'
              scannerMode: 'Other'
              extraProperties: |
                # Additional properties that will be passed to the scanner, 
                # Put one key=value per line, example:
                # sonar.exclusions=**/*.bin
                sonar.projectKey=hello-azure
          - task: Gradle@2
            inputs:
              gradleWrapperFile: 'gradlew'
              tasks: 'build'
              publishJUnitResults: true
              testResultsFiles: '**/TEST-*.xml'
              javaHomeOption: 'JDKVersion'
              sonarQubeRunAnalysis: true
              sqGradlePluginVersionChoice: 'specify'
              sonarQubeGradlePluginVersion: '3.1.1'
          - task: SonarQubePublish@4
            inputs:
              pollingTimeoutSec: '300'
  </code></pre>
  <p>I've also tried setting sonar.branch=main and sonar.branch.name=main  as <code>extraProperties</code>.</p>
  <p>This is the full log:</p>
  <pre><code>Starting: SonarQubePrepare
  ==============================================================================
  Task         : Prepare Analysis Configuration
  Description  : Prepare SonarQube analysis configuration
  Version      : 4.17.0
  Author       : sonarsource
  Help         : Version: 4.17.0. [More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
  ==============================================================================
  Finishing: SonarQubePrepare
  
  ...
  
  &gt; Task :compileTestKotlin
  &gt; Task :compileTestJava NO-SOURCE
  
  &gt; Task :sonarqube
  SonarScanner will require Java 11 to run starting in SonarQube 8.x
  
  &gt; Task :sonarqube FAILED
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':sonarqube'.
  &gt; No branches currently exist in this project. Please scan the main branch without passing any branch parameters.
  
  </code></pre>
  <p>What's wrong here?</p>
  <p><strong>UPDATE:</strong></p>
  <p>Oddly enough, running the sonarqube gradle task manually as a pipeline script works ok:</p>
  <pre><code>- script: ./gradlew sonarqube -Dsonar.projectKey=hello-azure -Dsonar.host.url=https://mysonarqubeserver  -Dsonar.login=mylogin
          
  </code></pre>
  <p><strong>UPDATE 2:</strong></p>
  <p>I changed the plugin version to 3.0</p>
  <pre><code>        - task: Gradle@2
            inputs:
              gradleWrapperFile: 'gradlew'
              tasks: 'build'
              publishJUnitResults: true
              testResultsFiles: '**/TEST-*.xml'
              javaHomeOption: 'JDKVersion'
              sonarQubeRunAnalysis: true
              sqGradlePluginVersionChoice: 'specify'
              sonarQubeGradlePluginVersion: '3.0'
  </code></pre>
  <p>Now this is the behaviour:</p>
  <ul>
  <li>When the application hasn't been previously created on SonarQube, it works fine the first time.</li>
  <li>Subsequent builds fail with <code>Unable to load component class org.sonar.scanner.scan.filesystem.InputComponentStore</code></li>
  </ul>
  <p>Log:</p>
  <pre><code>&gt; Task :sonarqube
  SonarScanner will require Java 11 to run starting in SonarQube 8.x
  
  &gt; Task :sonarqube FAILED
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':sonarqube'.
  &gt; Unable to load component class org.sonar.scanner.scan.filesystem.InputComponentStore
  </code></pre>
  <p>Here's the full stacktrace where the root cause is <code>Caused by: java.lang.NoSuchFieldError: SHORT</code>:</p>
  <pre><code>2021-02-17T22:52:41.8616402Z 2021-02-17T22:52:41.799+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':sonarqube'.
  2021-02-17T22:52:41.8617730Z 2021-02-17T22:52:41.800+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] &gt; Unable to load component class org.sonar.scanner.scan.filesystem.InputComponentStore
  2021-02-17T22:52:41.8618768Z 2021-02-17T22:52:41.800+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
  2021-02-17T22:52:41.8619739Z 2021-02-17T22:52:41.800+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
  2021-02-17T22:52:41.8620759Z 2021-02-17T22:52:41.800+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]  Run with --scan to get full insights.
  2021-02-17T22:52:41.8621690Z 2021-02-17T22:52:41.800+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
  2021-02-17T22:52:41.8622648Z 2021-02-17T22:52:41.800+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Exception is:
  2021-02-17T22:52:41.9079864Z 2021-02-17T22:52:41.802+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':sonarqube'.
  2021-02-17T22:52:41.9081980Z 2021-02-17T22:52:41.803+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]  at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:200)
  2021-02-17T22:52:41.9083995Z 2021-02-17T22:52:41.803+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]  at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263)
  ...
  2021-02-17T22:52:41.9577148Z 2021-02-17T22:52:41.849+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: java.lang.IllegalStateException: Unable to load component interface org.sonar.scanner.scan.branch.BranchConfiguration
  2021-02-17T22:52:41.9578725Z 2021-02-17T22:52:41.849+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]  at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:66)
  2021-02-17T22:52:41.9580213Z 2021-02-17T22:52:41.849+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]  at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
  2021-02-17T22:52:41.9581700Z 2021-02-17T22:52:41.849+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]  at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
  2021-02-17T22:52:41.9583224Z 2021-02-17T22:52:41.849+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]  at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
  2021-02-17T22:52:41.9584690Z 2021-02-17T22:52:41.849+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]  at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
  2021-02-17T22:52:41.9586243Z 2021-02-17T22:52:41.849+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]  at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
  2021-02-17T22:52:41.9587728Z 2021-02-17T22:52:41.849+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]  at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
  2021-02-17T22:52:41.9589239Z 2021-02-17T22:52:41.849+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]  at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
  2021-02-17T22:52:41.9637580Z 2021-02-17T22:52:41.849+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]  at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
  2021-02-17T22:52:41.9639629Z 2021-02-17T22:52:41.850+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]  at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
  2021-02-17T22:52:41.9641227Z 2021-02-17T22:52:41.850+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]  at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
  2021-02-17T22:52:41.9642650Z 2021-02-17T22:52:41.850+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]  at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
  2021-02-17T22:52:41.9644254Z 2021-02-17T22:52:41.850+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]  at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
  2021-02-17T22:52:41.9645676Z 2021-02-17T22:52:41.850+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]  at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
  2021-02-17T22:52:41.9647288Z 2021-02-17T22:52:41.850+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]  at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:64)
  2021-02-17T22:52:41.9648493Z 2021-02-17T22:52:41.851+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]  ... 129 more
  2021-02-17T22:52:41.9649561Z 2021-02-17T22:52:41.851+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: java.lang.NoSuchFieldError: SHORT
  ...
  2021-02-17T22:52:41.9729914Z 2021-02-17T22:52:41.851+0000 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 1m 42s
  </code></pre>