--- /dev/null
+create-sonarqube:
+ @echo "##### Create SonarQube #####"
+ docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube
+ @echo "************************************************"
+ @echo "*** Follow instructions from README_SONAR.md ***"
+ @echo "************************************************"
+ @echo "##### DONE #####"
+
+start-sonarqube:
+ @echo "##### Start SonarQube #####"
+ docker start sonarqube
+ @echo "************************************************"
+ @echo "*** Follow instructions from README_SONAR.md ***"
+ @echo "************************************************"
+ @echo "##### DONE #####"
+
+stop-sonarqube:
+ @echo "##### Stop SonarQube #####"
+ docker stop sonarqube
+ @echo "##### DONE #####"
+
--- /dev/null
+# Run SonarQube locally
+All instructions based at an article at https://www.vogella.com/tutorials/SonarQube/article.html
+
+## Configure and run SonarQube locally
+* Create and run SonarQube container
+ ```
+ make create-sonarqube
+ ```
+* Configure SonarQube
+
+ a). Log in at http://localhost:9000
+
+ 
+
+ Username: admin
+ Password: admin
+
+ b). Create a new Sonar project.
+
+ 
+
+ - Set project name
+
+ 
+
+ - Generate token
+
+ 
+
+ You should see
+
+ 
+
+ - Select code language and building technology
+
+ 
+
+ c). Run code analyse using command from a previous step.
+
+ Before code analyse ALWAYS execute:
+
+ ```
+ mvn clean test
+ ```
+
+ Next (from previous step):
+ ```
+ mvn sonar:sonar \
+ -Dsonar.projectKey=pnf-simulator \
+ -Dsonar.host.url=http://localhost:9000 \
+ -Dsonar.login=de5dac7da79a4de88876006a05457902aab1a3a3
+ ```
+ After command execution you should see at the console:
+ ```
+ [INFO] ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard?id=pnf-simulator
+ [INFO] Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
+ ```
+ Click at link http://localhost:9000/dashboard?id=pnf-simulator to see Sonar report
+ 
+
+ IMPORTANT: Please note command used to run code analise. You will need it later.
+
+## Stopping SonarQube
+If you do not want to repeat step **Configure and run SonarQube locally** you must use stopping and starting make goals.
+```
+ make stop-sonarqube
+```
+
+## Starting SonarQube
+If you do not want to repeat step **Configure and run SonarQube locally** you must use stopping and starting make goals.
+```
+ make start-sonarqube
+```
<quartz-jobs.version>2.2.1</quartz-jobs.version>
<guava.version>21.0</guava.version>
<logback-classic.version>1.2.3</logback-classic.version>
+ <sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
<!-- TEST DEPENDENCIES VERSION -->
<dependencyManagement>
<dependencies>
-
<!-- Compile DEPENDENCIES -->
-
+ <dependency>
+ <groupId>org.sonarsource.scanner.maven</groupId>
+ <artifactId>sonar-maven-plugin</artifactId>
+ <version>${sonar-maven-plugin.version}</version>
+ </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</profiles>
<build>
+ <pluginManagement>
+ <plugins>
+ <!-- To run SonarQube locally -->
+ <plugin>
+ <groupId>org.sonarsource.scanner.maven</groupId>
+ <artifactId>sonar-maven-plugin</artifactId>
+ <version>${sonar-maven-plugin.version}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
<plugins>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>