Sonarqube
By estefafdez.
Hello!
I am Estefanía Fernández
Head of QA at SDOS.
Una QA en Apuros Blog.
You can find me on Twitter as @estefafdez
Or Linkedin: https://es.linkedin.com/in/estefafdez
2
1.
Sonarqube
What is Sonarqube?
“
Sonarqube is an Open Source Platform for
Continuos Inspection of Code Quality.
4
Sonarqube is:
○ Open Source
○ Evaluate and improve our code.
○ Tools as: Checkstyle, PMD, FindBugs.
○ You can run it on Eclipse (or your favourite
IDE), locally on your computer or using
Docker.
5
Play With Docker
What is Play With Docker?
6
Play With
Docker:
○ Free Docker instances.
○ 4 hours duration.
○ Very useful tool to start with Docker.
○ Simple and without install anything on your
computer.
7
What we need to
start?
Maven Project.
Demo:
9
Add sonar into the
pom.xml
Run the project.
Selenium Cucumber Project
https://github.com/estefafdez/selenium-cucumber
10
11
Sonar
Dependencies <dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>4.5.4</version>
</dependency>
POM Dependencies section:
12
Sonar Maven
Plugin
<plugin>
<groupId>
Org.sonarsource.scanner.maven
</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.2</version>
</plugin>
POM Plugins section:
13
Sonar Profile
<profiles>
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<sonar.host.url> URL Sonar Docker </sonar.host.url>
</properties>
</profile>
</profiles>
POM Profile section:
Install Sonarqube on Docker.
14
15
Install
Sonarqube on
Docker:
docker pull sonarqube
docker run -d –name sonarqube -p
9000:9000 sonarqube
Run this commands:
Run your project.
16
17
Run your
project:
mvn clean install sonar:sonar
Run this commands on your project folder
in your terminal:
18
Once is finished….
Check your result on Sonar! 19
“
Live Example….
Start NOW!
20
Is always necessary to
improve the quality of your
own code!
Success!
Thanks!
Any questions?
You can find me at @estefafdez & estefafdez@gmail.com
http://estefafdez.com
https://unaqaenapuros.wordpress.com/
22

Sonarqube + Docker