SonarQube - * Version 8.9 (build 43852)
Scanner used from Azure DevOps extension in cli mode
Error:
org.sonar.java.AnalysisException: Your project contains .java files, please provide compiled classes with sonar.java.binaries property, or exclude them from the analysis with sonar.exclusions property.
These files are being picked up from my node_modules folder. However I had added node_modules to my exclusions as shown at the bottom of this.
Only typescript and javascript files seem to be ignored if they are in node_modules:
File newProject/node_modules/aws-cdk/lib/api/util/display.js was excluded by sonar.javascript.exclusions or sonar.typescript.exclusions
Other files are indexed:
newProject/node_modules/aws-cdk/lib/init-templates/v1/sample-app/java/src/main/java/com/myorg/%name.PascalCased%App.template.java' indexed with language 'java'
My intention is to exclude all of the node_modules folder, but I cannot figure out why this is so.
I have the following configuration in the azure devops extension, i had to add
sonar.javascript.node.maxspace as node was running out of memory during the scan.
- task: SonarQubePrepare@4
inputs:
SonarQube: Shell Energy Sonarqube
scannerMode: CLI
configMode: manual
cliProjectKey: '${{ parameters.ProjectKey }}'
cliProjectName: $(Build.DefinitionName)
cliProjectVersion: $(Build.BuildID)
cliSources: .
extraProperties: |
sonar.exclusions="**/node_modules/**/*","**/coverage/**/*", "**/coveragereport/**/*" , "dts-tooling-templates/**/*", "**/dist/**/*", "**/out/**/*"
sonar.projectName=$(Build.DefinitionName)
sonar.javascript.node.maxspace: 8192