I am currently trying to run sonarcloud scanning on a somewhat complicated project, which includes both multiple independent modules and multiple languages. I am able to use the maven SonarScanner to analyze the java components, or the GitHub Actions for Sonarcloud to scan the non-java components, but I have not yet been able to do both at once.
How should I configure this? Directory structure is equivalent to the following:
I have so far tried adding different settings for sonar.sources, or including the additional folders we want to scan as resources in the aggregate pomfile, but without luck.
- Github Actions
- JDK 11
mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=PROJECT_NAME
- Have also tried adding
-Dsonar.sources=.to get it to pick up additional files, with the error reported below
- If using
sonar.sources=.in command, error is
javaModule/pom.xml can't be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files
- If using
sonar.sources=mixedFiles/typescriptFiles,pythonFiles,terraform, error is
The directory '/home/runner/work/REPO_NAME/REPO_NAME/javaModule/terraform' does not exist for Maven module ***:javaModule:jar:1.0. Please check the property sonar.sources -> [Help 1]
- If not using sonar.sources property the scanner is able to run, but SonarCloud only scans Java components