SonarQube Server 5.1.2, Sonar-Runner 2.4
As provide in Multi-moduleProject i have created a project structure as
Accounts
|
->invoice
|
->src
->receipt
|
->src
->sonar.properties
File:sonar.properties
sonar.projectKey=org.mycompany.acc
sonar.projectName=Account
sonar.projectVersion=1.0
sonar.sources=src
sonar.modules=invoice,receipt
invoice.sonar.projectName=Invoice
receipt.sonar.projectName=Receipt
When execute with above configuration in sonar-runner i encountered with error "src" folder is missing in "Account" directory, hope this configuration is same as the conf available in that link. As per the understanding if the configuration is fine then the Invoice and Receipt will be listed as sub project under Account Project, so what are the changes are required in above configuration to achieve multi module / project under one project.
ERROR
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: The folder 'src' does not exist for 'org.mycompany.acc' (base
directory = C:\Users\xyz\Accounts\.)
ERROR:
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with t
he -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
Download the SonarQube Scanner (CLI), which provides a CLI to analyze projects of any language. Unpack the SonarQube Scanner and navigate into the conf directory. Open up the sonar-scanner.properties. You are ready to analyze your Multi-Module Maven Project! Imagine we have a Multi-Module Maven Project with the following structure
There are multiple ways of configuring SonarQube for your project. You may define the project settings on the parent-level, or overwrite properties in each module. For the sake of simplicity, let us just define the settings in the parent module. Create a sonar-project.properties file in the parent folder.
Let’s see how SonarQube works by running a project test using the example provided. To do so: Run the sonar-scanner command to start the analysis. Once it finishes, you will see in the log’s information that the analysis was successfully executed.
Navigate to the SonarQube UI, you will see that it is running an automatic analysis. As seen in the screenshot above, there is a bug, a vulnerability, and some code smells in the project. Let’s focus on the vulnerability to see how GitHub, Travis, and SonarQube synchronize their jobs.
try this:
sonar.projectKey=org.mycompany.acc
sonar.projectName=Account
sonar.projectVersion=1.0
sonar.sources=src # try to remove this by the way if you don't have suchdirectory under root folder of project
sonar.modules=invoice,receipt
invoice.sonar.projectName=Invoice
invoice.sonar.sources=invoice/src
receipt.sonar.projectName=Receipt
receipt.sonar.sources=receipt/src
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With