Skip to content

Commit 0c7e1cb

Browse files
committed
patch the maven git plugin for better developer experience
1 parent 557759e commit 0c7e1cb

File tree

2 files changed

+31
-5
lines changed

2 files changed

+31
-5
lines changed

hbase/Dockerfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,13 @@ WORKDIR /stackable
152152
RUN --mount=type=cache,id=maven-hbase-operator-tools-${HBASE_OPERATOR_TOOLS},uid=${STACKABLE_USER_UID},target=/stackable/.m2/repository <<EOF
153153
cd "$(/stackable/patchable --images-repo-root=src checkout hbase-operator-tools ${HBASE_OPERATOR_TOOLS})"
154154

155-
# Remove the Git repo because `git-commit-id-maven-plugin` tries to get the latest commit if a Git repo is present,
156-
# which fails due to a problem with worktrees, see https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/215
157-
rm .git
158-
159155
mvn \
160156
--batch-mode \
161157
--no-transfer-progress \
162158
-Dhbase.version=${PRODUCT} \
163159
-Dhbase-thirdparty.version=${HBASE_THIRDPARTY} \
164-
-Dmaven.tests.skip=true \
160+
-DskipTests \
161+
-Dmaven.test.skip=true \
165162
package assembly:single
166163

167164
# We need the "*" here as the directory won't be the same as the final tar file for SNAPSHOTs which we currently have to use for 2.6
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From 187db522edc569def2aea3f9453ecb1a674592fe Mon Sep 17 00:00:00 2001
2+
From: Razvan-Daniel Mihai <[email protected]>
3+
Date: Wed, 7 May 2025 10:26:37 +0200
4+
Subject: Configure git-commit-id-plugin to use native git
5+
6+
This fixes the problem that jgit cannot handle worktrees and the build
7+
fails.
8+
9+
See
10+
https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/215
11+
---
12+
hbase-hbck2/pom.xml | 3 ++-
13+
1 file changed, 2 insertions(+), 1 deletion(-)
14+
15+
diff --git a/hbase-hbck2/pom.xml b/hbase-hbck2/pom.xml
16+
index fd0018c..f00bd18 100644
17+
--- a/hbase-hbck2/pom.xml
18+
+++ b/hbase-hbck2/pom.xml
19+
@@ -215,8 +215,9 @@
20+
<plugin>
21+
<groupId>pl.project13.maven</groupId>
22+
<artifactId>git-commit-id-plugin</artifactId>
23+
- <version>2.2.5</version>
24+
+ <version>4.9.10</version>
25+
<configuration>
26+
+ <useNativeGit>true</useNativeGit>
27+
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
28+
<commitIdGenerationMode>flat</commitIdGenerationMode>
29+
<failOnNoGitDirectory>false</failOnNoGitDirectory>

0 commit comments

Comments
 (0)