From f139138cf9723a3953ade73cf905b1e03090de6d Mon Sep 17 00:00:00 2001 From: Roberto Oliveira Date: Tue, 23 Jul 2024 16:34:17 -0400 Subject: [PATCH] [SRVLOGIC-286] fix issue when extracting project version when there is no pom.xml available (like operator repo) --- .ci/jenkins/Jenkinsfile.prod.nightly | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.ci/jenkins/Jenkinsfile.prod.nightly b/.ci/jenkins/Jenkinsfile.prod.nightly index 2265a0250..3a3ba8a81 100644 --- a/.ci/jenkins/Jenkinsfile.prod.nightly +++ b/.ci/jenkins/Jenkinsfile.prod.nightly @@ -258,8 +258,10 @@ pipeline { def sanitizedProjectName = f.replaceAll('/', '_').replaceAll('-', '_') def buildScript = env["PME_BUILD_SCRIPT_${sanitizedProjectName}"] def pomPath = maven.getProjectPomFromBuildCmd(buildScript) - if (new File(pomPath).exists()) { + try { env["VERSION_${f}"] = maven.mvnGetVersionProperty(new MavenCommand(this).withProperty('productized'), 'project.version', pomPath) + } catch (err) { + echo "Skipping to get version of project ${projectName} as no pom.xml was found" } } }