A problem was found with the configuration of task ':sonarResolver' (since 7.0.0.6105)

When both Jandex and SonarQube Gradle Plugins are present in the same project, it results in:

A problem was found with the configuration of task ':sonarResolver' (type 'BuildFeaturesEnabledResolverTask').
  - Gradle detected a problem with the following location: 'sonar-jandex-repro/build/resources/main'.

* Try:
> Declare task ':jandex' as an input of ':sonarResolver'
> Declare an explicit dependency on ':jandex' from ':sonarResolver' using Task#dependsOn
> Declare an explicit dependency on ':jandex' from ':sonarResolver' using Task#mustRunAfter

The behaviour was introduced in this commit SCANGRADLE-247 Resolve class paths through a dedicated project based … · SonarSource/sonar-scanner-gradle@a50ce7d · GitHub

Reproducer is here: GitHub - BrianSetz/sonar-jandex-dep-reproducer

Simply run:

./gradlew sonarResolver

Workaround:

tasks.named("sonarResolver") {
    dependsOn("jandex")
}

I would love a more structural solution to this problem, any thoughts?

Hi @BrianRUG,

Thanks for sharing the issue and the sample project. I was able to reproduce the issue with the jandex plugin and will be investigating the topic further as part of this ticket.

Cheers,

Dorian

1 Like

Thanks a lot Dorian!