diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..4986383 --- /dev/null +++ b/pom.xml @@ -0,0 +1,16 @@ + + 4.0.0 + + com.example + my-java-17-project + 1.0-SNAPSHOT + + + 17 + 17 + + + + + diff --git a/sonarqube/Jenkinsfile b/sonarqube/Jenkinsfile index 72d66c1..1fc60b2 100644 --- a/sonarqube/Jenkinsfile +++ b/sonarqube/Jenkinsfile @@ -1,12 +1,12 @@ pipeline{ agent any environment { - PATH = "$PATH:/opt/apache-maven-3.8.2/bin" + PATH = "$PATH:/usr/share/maven/bin" } stages{ stage('GetCode'){ steps{ - git 'https://github.com/ravdy/javaloginapp.git' + git 'https://github.com/saikrishna-M-8520/DevOps.git' } } stage('Build'){ @@ -17,13 +17,34 @@ pipeline{ stage('SonarQube analysis') { // def scannerHome = tool 'SonarScanner 4.0'; steps{ - withSonarQubeEnv('sonarqube-8.9') { + withSonarQubeEnv('sonarqube-8.3') { // If you have configured more than one global server connection, you can specify its name // sh "${scannerHome}/bin/sonar-scanner" sh "mvn sonar:sonar" } } } + stage('Upload jar To Nexus'){ + steps{ + script{ + nexusArtifactUploader artifacts: [ + [ + artifactId: 'my-java-17-project', + classifier: '', + file: "target/my-java-17-project-1.0-SNAPSHOT.jar", + type: 'jar' + ] + ], + credentialsId: 'nexus3', + groupId: 'com.mycompany.app', + nexusUrl: '54.236.196.83:8081', + nexusVersion: 'nexus3', + protocol: 'http', + repository: 'vprofile-release', + version: '1' + } + } + } } }