Gradle sonarqube tasks fails when any directory in the properties doesn't exist

  • Gradle 5.0, sonarqube-gradle-plugin 2.7.0.1622, sonarqube 6.7.5
  • When any of the gradle config properties contains directories that don’t exist, sonarqube task fails
    Execution failed for task ‘:sonarqube’.

No files nor directories matching ‘build/resources/main’

I thought this was addressed by SONARGRADL-49 Filter unexisting paths before populating sonar.java.te… by henryju · Pull Request #40 · SonarSource/sonar-scanner-gradle · GitHub
But the SonarQubePlugin.java changed significantly after 2.6.2 and it doesn’t filter directories in 2.7 versions.

Hi,

If you specify missing directories in your analysis properties, analysis will fail - as a feature. We prefer fail-fast, and if the directories you’ve configured aren’t there, clearly something is wrong that you probably want to know about. Instead of continuing analysis and giving you bad results, we stop the process so you’ll take a look.

 
Ann