diff --git a/Jenkinsfile b/Jenkinsfile index acaec377a..5184adf89 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,9 +7,27 @@ pipeline { url: 'https://github.com/Bharatkumar5690/spring-petclinic.git' } } - stage('Build') { + stage ('Artifactory configuration') { steps { - sh 'mvn package' + rtServer ( + id: "ARTIFACTORY_SERVER", + url: 'https://sbharatkumar.jfrog.io/artifactory', + credentialsId: 'JFROG_CLOUD_ADMIN' + ) + + rtMavenDeployer ( + id: "MAVEN_DEPLOYER", + serverId: "ARTIFACTORY_SERVER", + releaseRepo: 'libs-release', + snapshotRepo: 'libs-snapshot' + ) + + rtMavenResolver ( + id: "MAVEN_RESOLVER", + serverId: "ARTIFACTORY_SERVER", + releaseRepo: 'libs-release', + snapshotRepo: 'libs-snapshot' + ) } } stage('Test the code by using sonarqube') { @@ -19,6 +37,19 @@ pipeline { } } } + stage ('Exec Maven') { + steps { + rtMavenRun ( + tool: 'MAVEN_DEFAULT', + pom: 'pom.xml', + goals: 'clean install', + deployerId: "MAVEN_DEPLOYER", + ) + rtPublishBuildInfo ( + serverId: "ARTIFACTORY_SERVER" + ) + } + } stage('Gathering the artifacts & test results') { steps { archiveArtifacts artifacts: '**/target/*.jar',