Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Jenkinsfile.txt #3

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 52 additions & 6 deletions Jenkinsfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,58 @@ pipeline {

// *****ALL CODE TO BE ADDED BELOW THIS COMMENT*****






//Code starts for stage Clean
stage('Clean') {
steps {
sh 'mvn clean'
}
}


//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

stage('Static Code Analysis') {
steps {
script {
scannerHome = tool 'sonar-scanner'
}
withSonarQubeEnv('MySonarQubeServer')
{
sh "${scannerHome}/bin/sonar-scanner"
}
}
}
//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*****
}
}
}