5.1 Simple Analysis using SonarScanner
Below is the basic code to create the sonar-project.properties file to compile the code and analyse it.
* - REPLACE WITH APPROPRIATE CONTENTS FOR THE LINES WITH ANGULAR BRACES <>
If you want to validate the project then first you must navigate to the project folder in command prompt and hit the following command
sonar-scanner
The above command requires the sonar-project.properties file to be available in the project location otherwise it gives error messages.After saving the above code try to run the code using the following lines
If you haven't set the environment variables then run using the following commands
cd C:\<workspace location>\<ProjectName>\sonar-project.properties C:\<sonar-scanner-installation directory>\bin\sonar-scanner.bat
If you have set the environment variables set for sonar scanner then type the following command
sonar-scanner sonar-tester.properties
After we get a success message we can view it in the dashboard of sonarQube.
Last updated
Was this helpful?