diff --git a/Jenkinsfile b/Jenkinsfile
index aaee540..dd640cd 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -21,5 +21,16 @@ pipeline {
sh 'mvn install'
}
}
+
+ stage('QA') {
+ steps {
+ withSonarQubeEnv('sonar') {
+ script {
+ def scannerHome = tool 'sonarqube-scanner'
+ sh "${scannerHome}/bin/sonar-scanner"
+ }
+ }
+ }
+ }
}
-}
\ No newline at end of file
+}
diff --git a/README.md b/README.md
index 4c5d12d..494ede9 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ The validator uses the free API of https://haveibeenpwned.com/ by [@troyhunt](ht
validate that the password has not been previously exposed in data breaches.
[](https://ci.martinspielmann.de/job/pingunaut/job/wicket-pwnedpasswords-validator/job/master/)
-
+[](https://sonarcloud.io/component_measures?id=wicket-pwnedpasswords-validator&metric=coverage)
## Usage
1. Include maven dependency in your pom.xml
diff --git a/pom.xml b/pom.xml
index eeeec54..b1e4087 100644
--- a/pom.xml
+++ b/pom.xml
@@ -158,6 +158,47 @@
${wtp.version}
+
+ org.jacoco
+ jacoco-maven-plugin
+ 0.8.0
+
+
+ jacoco-initialize
+
+ prepare-agent
+
+
+
+ jacoco-report
+ prepare-package
+
+ report
+
+
+
+ post-unit-test
+ test
+
+ report
+
+
+ target/jacoco.exec
+ target/jacoco-ut
+
+
+
+
+ surefireArgLine
+
+
+
+ maven-surefire-plugin
+ 2.20.1
+
+ ${surefireArgLine}
+
+
diff --git a/sonar-project.properties b/sonar-project.properties
new file mode 100644
index 0000000..c084b40
--- /dev/null
+++ b/sonar-project.properties
@@ -0,0 +1,11 @@
+sonar.projectKey=wicket-pwnedpasswords-validator
+sonar.organization=pingunaut-github
+sonar.sources=src/main/java
+sonar.tests=src/test/java
+sonar.sourceEncoding=UTF-8
+sonar.java.binaries=target/classes
+sonar.java.test.binaries=target/test-classes
+sonar.junit.reportPaths=target/surefire-reports
+sonar.java.coveragePlugin=jacoco
+sonar.jacoco.reportPaths=target/jacoco.exec
+