From 14198a5b38ba7dd25c12abd2a8d326dcc2e2c03a Mon Sep 17 00:00:00 2001 From: naresha24 <51454216+naresha24@users.noreply.github.com> Date: Fri, 7 Jun 2019 17:17:33 +0530 Subject: [PATCH 1/5] Update Jenkinsfile.txt Adding the Stage Clean Code --- Jenkinsfile.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile.txt b/Jenkinsfile.txt index 84fff7f..0e843d2 100644 --- a/Jenkinsfile.txt +++ b/Jenkinsfile.txt @@ -4,7 +4,12 @@ pipeline { // *****ALL CODE TO BE ADDED BELOW THIS COMMENT***** - + //Code starts for stage Clean + stage('Clean') { + steps { + sh 'mvn clean' + } + } @@ -12,4 +17,4 @@ pipeline { // *****ALL CODE TO BE ADDED ABOVE THIS COMMENT***** } -} \ No newline at end of file +} From 56e57d2dc2b128a68986bfcaf679e5df5d68b2f7 Mon Sep 17 00:00:00 2001 From: naresha24 <51454216+naresha24@users.noreply.github.com> Date: Fri, 7 Jun 2019 23:45:43 -0700 Subject: [PATCH 2/5] Update Jenkinsfile.txt Added PMD --- Jenkinsfile.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Jenkinsfile.txt b/Jenkinsfile.txt index 0e843d2..0208f83 100644 --- a/Jenkinsfile.txt +++ b/Jenkinsfile.txt @@ -12,6 +12,23 @@ pipeline { } + //Code starts for stage PMD + stage('PMD') { + steps { + sh 'mvn site' + } + } + //Code ends for stage PMD + + + + //Code starts for stage Compile + stage('Compile') { + steps { + sh 'mvn compile' + } + } + //Code Ends for stage Compile From bfc79d30f674132bd4024909cd977198ef600ffb Mon Sep 17 00:00:00 2001 From: naresha24 <51454216+naresha24@users.noreply.github.com> Date: Sat, 8 Jun 2019 00:05:39 -0700 Subject: [PATCH 3/5] Update Jenkinsfile.txt --- Jenkinsfile.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Jenkinsfile.txt b/Jenkinsfile.txt index 0208f83..05bcf67 100644 --- a/Jenkinsfile.txt +++ b/Jenkinsfile.txt @@ -30,6 +30,18 @@ pipeline { } //Code Ends for stage Compile + stage('Static Code Analysis') { + steps { + script { + scannerHome = tool 'sonar-scanner' + } + withSonarQubeEnv('My SonarQube Server') + { + sh "${scannerHome}/bin/sonar-scanner" + } + } + } + //Code ends for stage Static Code Analysis // *****ALL CODE TO BE ADDED ABOVE THIS COMMENT***** From 06ec942031b07c6577cd850cadaa0781e73e6f83 Mon Sep 17 00:00:00 2001 From: naresha24 <51454216+naresha24@users.noreply.github.com> Date: Sat, 8 Jun 2019 00:21:40 -0700 Subject: [PATCH 4/5] MySonarQubeServer MySonarQubeServer --- Jenkinsfile.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile.txt b/Jenkinsfile.txt index 05bcf67..d7f5132 100644 --- a/Jenkinsfile.txt +++ b/Jenkinsfile.txt @@ -35,7 +35,7 @@ pipeline { script { scannerHome = tool 'sonar-scanner' } - withSonarQubeEnv('My SonarQube Server') + withSonarQubeEnv('MySonarQubeServer') { sh "${scannerHome}/bin/sonar-scanner" } From ffb942d5110d9cc7ff3076daf4ce96729fbe7eff Mon Sep 17 00:00:00 2001 From: naresha24 <51454216+naresha24@users.noreply.github.com> Date: Sat, 8 Jun 2019 00:26:08 -0700 Subject: [PATCH 5/5] Unit Test Code Unit Test Code Changes --- Jenkinsfile.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Jenkinsfile.txt b/Jenkinsfile.txt index d7f5132..818152f 100644 --- a/Jenkinsfile.txt +++ b/Jenkinsfile.txt @@ -43,6 +43,18 @@ pipeline { } //Code ends for stage Static Code Analysis + //Code starts for stage Unit Test + stage('Unit Test') { + steps { + sh 'mvn test' + } + post { + always { + junit 'target/surefire-reports/*.xml' + } + } + } + //Code ends for stage Unit Test // *****ALL CODE TO BE ADDED ABOVE THIS COMMENT***** }