-
Notifications
You must be signed in to change notification settings - Fork 0
Code Quality Sonar
Step 1: Download sonar zip from
https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-7.5.zip
Step 2: create postgres database named : sonarqube
Step 3: after extracting zip add this properties in sonarqube-7.5\conf\sonar.properties
sonar.jdbc.username=postgres (your username)
sonar.jdbc.password=root (your password)
sonar.jdbc.url=jdbc:postgresql://localhost:5432/sonarqube
Step 4: run sonar with command line StartSonar.bat :
sonarqube-7.5\bin\windows-x86-64> StartSonar.bat
Step 5: run command line "mvn clean install" in your local project run command line "mvn sonar:sonar" always in your local project
Step 6: acces to sonar with : http://localhost:9000
NB : every change of your code, you should redo the step 5 in order to refrech statistics.
Step 1 : add new file 'sonar-project.properties' in root of your project near to pom.xml with properties :
# Required metadata
sonar.projectKey=TutorialHibernatePostgres
sonar.projectName=Simple Java project analyzed with the SonarQube Runner
sonar.projectVersion=1.0
# Comma-separated paths to directories with sources (required)
sonar.sources=src
sonar.java.binaries=target
# Language
sonar.language=java
# Encoding of the source files
sonar.sourceEncoding=UTF-8
Step 2: in jenkins section 'Post Steps'
Add Execute SonarQube Scanner
Instead of creating a file add all the properties in 'Analysis properties'