-
Notifications
You must be signed in to change notification settings - Fork 6
How to run SonarQube analysis on local
Jordan Walker edited this page Jun 23, 2020
·
1 revision
I was able to run sonarqube analysis on my local and I will list the steps here so anyone watching this issue can replicate:
- Add these at project level build.gradle -
plugins {
id "jacoco"
id "org.sonarqube" version "2.7.1"
}
jacocoTestReport {
reports {
xml.enabled true
}
}
- Run sonarqube instance on docker by running
docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube
- Open
localhost:9000
and login by admin/admin - After logging in click ok "Create New Project" and Enter Project Key = "Check-ins" and click next
- Input a token name and click "Generate a token name"
- Then run
./gradlew sonarqube -x test -Dsonar.projectKey=Checkins-project -Dsonar.host.url=http://localhost:9000 -Dsonar.login=YOUR TOKEN THAT WAS GENERATED IN STEP 5
Once you run STEP 5, then page will reload and show you the code analysis on localhost:9000.
NOTE : I did sonarqube -x test
because tests are failing so for now i used this option to generate a report.