From d9319e645c7522c3bd76bed7117dc98ecd530f9b Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Thu, 10 Aug 2023 22:28:49 +0800 Subject: [PATCH] storpool: fix pom.xml which caused docker image build failures (#7845) steps to reproduce the issue: - git clone https://github.com/apache/cloudstack.git - cd cloudstack - rm -rf .git/ - run `mvn -P developer,systemvm clean install` Without this PR, it fails with error ``` > [ 8/10] RUN mvn -Pdeveloper -Dsimulator -DskipTests clean install: 668.1 [ERROR] Failed to execute goal pl.project13.maven:git-commit-id-plugin:4.9.10:revision (get-the-git-infos) on project cloud-plugin-storage-volume-storpool: .git directory is not found! Please specify a valid [dotGitDirectory] in your pom.xml -> [Help 1] ``` --- plugins/storage/volume/storpool/pom.xml | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/plugins/storage/volume/storpool/pom.xml b/plugins/storage/volume/storpool/pom.xml index ee4c5cfb6f0..058f3e678ed 100644 --- a/plugins/storage/volume/storpool/pom.xml +++ b/plugins/storage/volume/storpool/pom.xml @@ -69,6 +69,31 @@ + + org.codehaus.gmaven + gmaven-plugin + 1.5 + + + set-properties + validate + + execute + + + 1.7 + + File git = new File("./.git") + if (!git.exists()) { + pom.properties['storpool.skip.git.properties'] = 'true' + } else { + pom.properties['storpool.skip.git.properties'] = 'false' + } + + + + + maven-surefire-plugin @@ -96,6 +121,7 @@ + ${storpool.skip.git.properties} ${project.basedir}/.git git false