Skip to content

Instantly share code, notes, and snippets.

@hardyscc
Last active August 8, 2024 01:10
Show Gist options
  • Save hardyscc/1ab4959ef82b5be0ee902840d617f320 to your computer and use it in GitHub Desktop.
Save hardyscc/1ab4959ef82b5be0ee902840d617f320 to your computer and use it in GitHub Desktop.

Self-hosted Sonarqube

Start Docker Instance

docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:9-community

Generate Token

  1. Goto http://localhost:9000 login as admin/admin, then change password
  2. Goto http://localhost:9000/admin/users, click on Update Tokens and create a default token.

Run Sonar Scanner

Maven

./mvnw clean verify sonar:sonar -Dsonar.login=<your-default-token>

NPM

npx [email protected] -Dsonar.login=<your-default-token>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment