Skip to content

Commit d9319e6

Browse files
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] ```
1 parent 1605b2f commit d9319e6

File tree

1 file changed

+26
-0
lines changed
  • plugins/storage/volume/storpool

1 file changed

+26
-0
lines changed

plugins/storage/volume/storpool/pom.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,31 @@
6969
</dependencies>
7070
<build>
7171
<plugins>
72+
<plugin>
73+
<groupId>org.codehaus.gmaven</groupId>
74+
<artifactId>gmaven-plugin</artifactId>
75+
<version>1.5</version>
76+
<executions>
77+
<execution>
78+
<id>set-properties</id>
79+
<phase>validate</phase>
80+
<goals>
81+
<goal>execute</goal>
82+
</goals>
83+
<configuration>
84+
<providerSelection>1.7</providerSelection>
85+
<source>
86+
File git = new File("./.git")
87+
if (!git.exists()) {
88+
pom.properties['storpool.skip.git.properties'] = 'true'
89+
} else {
90+
pom.properties['storpool.skip.git.properties'] = 'false'
91+
}
92+
</source>
93+
</configuration>
94+
</execution>
95+
</executions>
96+
</plugin>
7297
<plugin>
7398
<artifactId>maven-surefire-plugin</artifactId>
7499
<configuration>
@@ -96,6 +121,7 @@
96121
</execution>
97122
</executions>
98123
<configuration>
124+
<skip>${storpool.skip.git.properties}</skip>
99125
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
100126
<prefix>git</prefix>
101127
<verbose>false</verbose>

0 commit comments

Comments
 (0)