diff --git a/jenkinsfile b/jenkinsfile new file mode 100644 index 0000000..1f51a9f --- /dev/null +++ b/jenkinsfile @@ -0,0 +1,27 @@ +pipeline { + agent any + stages { + stage('SM') { + steps { + checkout scmGit(branches: [[name: '*/UAT']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/Rajnikanthyadav336/java-example.git']]) + } + } + stage('SonarQube Analysis') { + tools { + maven 'Default Maven' + } + steps { + withSonarQubeEnv(installationName: 'sonar') { + sh "mvn clean test sonar:sonar -Dsonar.projectKey=sonar1" + } + } + } + stage('Quality Gate') { + steps { + timeout(time: 1, unit: 'HOURS') { + waitForQualityGate abortPipeline: true + } + } + } +} +} diff --git a/pom.xml b/pom.xml index 7f5d8b9..f3a12ad 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ test - +