From 6d02d5f0f47a64307d8745bb497d201b7f07ab6f Mon Sep 17 00:00:00 2001 From: VSAzima Date: Thu, 22 Apr 2021 19:00:55 +0400 Subject: [PATCH] readmavenpom --- Jenkinsfile | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8279b68e0..c22e8edc9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,30 +27,30 @@ pipeline { stage('push') { steps { script { - pom = readMavenPom file: "pom.xml"; - filesByGlob = findFiles(glob: "target/*.${pom.packaging}"); - echo "${filesByGlob[0].name} ${filesByGlob[0].path} ${filesByGlob[0].directory} ${filesByGlob[0].length} ${filesByGlob[0].lastModified}" - artifactPath = filesByGlob[0].path; - artifactExists = fileExists artifactPath; - if(artifactExists) { - echo "*** File: ${artifactPath}, group: ${pom.groupId}, packaging: ${pom.packaging}, version ${pom.version}"; - nexusArtifactUploader( - nexusVersion: NEXUS_VERSION, - protocol: NEXUS_PROTOCOL, - nexusUrl: NEXUS_URL, - groupId: pom.groupId, - version: pom.version, - repository: NEXUS_REPOSITORY, - credentialsId: NEXUS_CREDENTIAL_ID, - artifacts: [ - [artifactId: pom.artifactId, - classifier: '', - file: artifactPath, - type: pom.packaging], - [artifactId: pom.artifactId, - classifier: '', - file: "pom.xml", - type: "pom"] + pom = readMavenPom file: "pom.xml"; + filesByGlob = findFiles(glob: "target/*.${pom.packaging}"); + echo "${filesByGlob[0].name} ${filesByGlob[0].path} ${filesByGlob[0].directory} ${filesByGlob[0].length} ${filesByGlob[0].lastModified}" + artifactPath = filesByGlob[0].path; + artifactExists = fileExists artifactPath; + if(artifactExists) { + echo "*** File: ${artifactPath}, group: ${pom.groupId}, packaging: ${pom.packaging}, version ${pom.version}"; + nexusArtifactUploader( + nexusVersion: NEXUS_VERSION, + protocol: NEXUS_PROTOCOL, + nexusUrl: NEXUS_URL, + groupId: pom.groupId, + version: pom.version, + repository: NEXUS_REPOSITORY, + credentialsId: NEXUS_CREDENTIAL_ID, + artifacts: [ + [artifactId: pom.artifactId, + classifier: '', + file: artifactPath, + type: pom.packaging], + [artifactId: pom.artifactId, + classifier: '', + file: "pom.xml", + type: "pom"] ] ); } else {