Sonarcube on local

less than 1 minute read

Run sonarcube from Docker

docker run -d \
  --name sonarqube \
  -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true \
  -p 9000:9000 \
  sonarqube:latest

Run sonarcube analysis

Local project

Set up project for Clean as You Code

  • Use the global Setting

Analysis Method

  • locally

Analyze your project

  1. Provide a token
  2. Run analysis on your project
Gradle Project
./gradlew sonar \
  -Dsonar.projectKey=JavaConcepts \
  -Dsonar.projectName='JavaConcepts' \
  -Dsonar.host.url=http://localhost:9000 \
  -Dsonar.token=sqp_4bc2edb73227baac04fe2fa8ba546263f2d2e12a
Maven Project
mvn clean verify sonar:sonar \
-Dsonar.projectKey=Mockito \
-Dsonar.projectName='Mockito' \
-Dsonar.host.url=http://localhost:9000 \
-Dsonar.token=sqp_6e746c1c1ff4b34c535c341ff38299463d9ea005

Tags:

Categories:

Updated: