Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
Showing results for 
Search instead for 
Did you mean: 
Active Contributor
Hi all,

Today I would like to comment on an indispensable (free)software in the continuous delivery of our projects.

The official definition is:
"SonarQube provides the capability to not only show health of an application but also to highlight issues newly introduced. With a Quality Gate in place, you can fix the leak and therefore improve code quality systematically."

For us, it allows us to detect possible bugs of our project and manage the corrections. It allows us to improve the quality of the presented software.

So, let's go to install this fabulous software on your local PC (this guide is made for windows, although it is available in different platforms).



(based on: http://(based on: )

1.- Install local data base: SonarQube needs a local database, in our case we will use postgres. Go to and download and install postgres.

When the installation has completed, install your local database storage on C:\pgsqldb, to do this, user this command "initdb -D C:\pgsqldb".

2.- Assing local windows path for postgres commands and then start your local database server with command: "postgres -D C:\pgsqldb > C:\pgsqldb\logs\logfile.log 2>&1 &"

(NOTE): you can user the following .bat file to do second stept automatically:
REM The script sets environment variables helpful for PostgreSQL
@SET PATH="C:\pgsql\bin";%PATH%
@SET PGDATA=C:\pgsqldb
@SET PGUSER=postgres
@SET PGLOCALEDIR=C:\pgsqldb\share\locale
REM "C:\pgsql\bin\initdb"
"C:\pgsql\bin\pg_ctl" -D "C:\pgsqldb" -l logfile start
ECHO "Click enter to stop"
"C:\pgsql\bin\pg_ctl" -D "C:\pgsqldb" stop -m fast

3. Prepare Postgres using pgAdmin on Windows > PostgresSQL x.x > pgAdmin X.

In console, we have to create a new database server, click on Server > Create > Server...

In the options add the followin parameters:

  • General: Add name (free text)

  • Connections: add server address, port, database name, user and password

Save this options.

- It is important don't use the admin user to connect the sonarQube to the database. So let's go to create a new user on "Servers > your server > Login/Groups Roles". Then right click on "Login/Groups Roles" and create > Login/Groups Roles.

Add name:

Add password on definition tab:

Modify privileges as follow:

- After create server, you need to create a new database, this is a easy stept. Goes to "Servers > your server > Databases" and click on right button and then "create database". The name of database is "sonar" and the owner is "sonar" user (the user created before).

And then add definiton:

Install SonarQube and start server

4.- Download sonarQube files from

After downloading the file, Unzip this file in the folder that you think appropriate. In my case (C:/).

5.- We will modify the sonarQube configuration file to add the connection of the own database. Go to file "C:\sonarqube\conf\" and add the following lines:

#PostgreSQL configuration

6.- Start the SonarQube server in folder C:\sonarqube\bin\windows-x86-64 (depending on your operating system) and executing the file "StartSonar.bat".

Let's use SonarQube

7.- In your browser goes to http://localhost:9000/ 

Then, on the right side we will "Log in". And log in as administrator, by default:

  • Login: admin

  • Password: admin

8.- Install new plugins. My recommendation is to install "Sonarjs", "CSS/SCSS/Less" and "Sonarxml".

Todo this, goes to "Administration > System > Update Center" and then search plugin and push on "install". After install all plugins you must restart aplication.


Prepare run the analysis

9.- Before we can perform the analysis, we need to install the sonarQube analysis client. We will download the client program at

Then unzip the files, in my case in "C:\sonar-runner" and add path variable on to windows.


10.- Add file configuration called  "" at the root of the project "\WebContent" with the following content (sonar.projectName and sonar.projectKey text can be customized):


# To import the LCOV report

You can user "sonar.exclusions" to discard files or folders.


Execute analisis and get results

11.- In the system symbol, you can execute the command "sonar-runner". At the end of the analysis we will have the following result

12.- Then in http://localhost:9000/projects you can analyze the results of the analysis:

For more information:


In next post I will add examples of the use of this tool in our projects ui5
Labels in this area