Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
SonarQube configuration with PostgreSQL
1. In PostgreSQL database
1.1 Create user
create user <user_name> with password '<password>';
1.2 Create database
create database <db_name> with owner <user_name> encoding 'UTF8';
2. Edit <sonar_install_dir>/conf/
# Web context. When set, it must start with forward slash (for example /sonarqube).
# TCP port for incoming HTTP connections. Default value is 9000.
3. Open port
sudo iptables -A INPUT -p tcp --dport 9999 -j ACCEPT
4. Run SonarQube with <sonar_install_dir>/<so_env>/bin/
5. Login as admin and generate token
6. You can use it with maven:
mvn sonar:sonar<host>:<port>/<web_context> -Dsonar.login=<generated_token>
To exclude for example JS files add -Dsonar.exclusions=**/*.js to the above command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment