Must-share information (formatted with Markdown):
which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
Roshni - SonarQube version: 7.9.1
what are you trying to achieve
Roshni - We have maven multi module project where all the java code resides in parent project source folder(src/main/java) and child module refers to the parent source code.
while running sonar scanner on the parent project, it skips the parent source code and looks for child module basedir which leads to[WARNING] File is ignored. It is not located in module basedir.
No java files are getting scanned with message “The main branch of this project is empty.”
what have you tried so far to achieve this
I have tried below options.
- Adding CLI property to parent project : " -Dsonar.sources=src\main\java"
This fails as it looks for the source in child module and some of the child module do not have source code.
- Adding CLI property to parent project : “-Dsonar.projectBaseDir=src\main\java”
This doesnt fail but still skips the source code from parent folder.
- Adding sonar-project.properties to add source in Child modules - “sonar.sources=…\src\main\java”
Same result, skips the code from parent source code.
- Adding sonar-project.properties to add source to Parent module.
Still skips the source java files. I couldnt find entry in log to assure that the properties were successfully read from properties file.
Please assist in fixing this issue.
Please note - The project maven structure is designed in to support reverse code dependencies to avoid code duplication across child modules as the child modules refers to some common classes and are interdependent.