This is an automated email from the ASF dual-hosted git repository.
weizhou pushed a commit to branch 4.18
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.18 by this push:
new d9319e645c7 storpool: fix pom.xml which caused docker image build
failures (#7845)
d9319e645c7 is described below
commit d9319e645c7522c3bd76bed7117dc98ecd530f9b
Author: Wei Zhou <[email protected]>
AuthorDate: Thu Aug 10 22:28:49 2023 +0800
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 @@
</dependencies>
<build>
<plugins>
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <version>1.5</version>
+ <executions>
+ <execution>
+ <id>set-properties</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <providerSelection>1.7</providerSelection>
+ <source>
+ File git = new File("./.git")
+ if (!git.exists()) {
+
pom.properties['storpool.skip.git.properties'] = 'true'
+ } else {
+
pom.properties['storpool.skip.git.properties'] = 'false'
+ }
+ </source>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
@@ -96,6 +121,7 @@
</execution>
</executions>
<configuration>
+ <skip>${storpool.skip.git.properties}</skip>
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
<prefix>git</prefix>
<verbose>false</verbose>