]> juplo.de Git - demos/kafka/training/commitdiff
pom.xml/build.gradle: git-Info-Plugins nur ausführen, wenn .git-Verzeichnis existiert
authorKai Moritz <kai.milan.moritz@googlemail.com>
Sun, 31 May 2026 12:52:12 +0000 (12:52 +0000)
committerKai Moritz <kai.milan.moritz@googlemail.com>
Fri, 12 Jun 2026 18:47:01 +0000 (18:47 +0000)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
build.gradle
pom.xml

index 73b76a85bdbd4060b35e4ee23bb9cdd4684cb163..6bc2bd9a67849f15366d1afc953465923bc06bc6 100644 (file)
@@ -52,3 +52,7 @@ springBoot {
 bootBuildImage {
        imageName = "juplo/${project.name}:${project.version}"
 }
+
+tasks.named('generateGitProperties') {
+       onlyIf { file("${rootDir}/.git").exists() }
+}
diff --git a/pom.xml b/pom.xml
index 8426214747cc6dd73ab4ac78333bb8cbf8393e0e..7a123fd0b302dfabacb62f68b2ef4819766ba83e 100644 (file)
--- a/pom.xml
+++ b/pom.xml
           </execution>
         </executions>
       </plugin>
-      <plugin>
-        <groupId>pl.project13.maven</groupId>
-        <artifactId>git-commit-id-plugin</artifactId>
-      </plugin>
     </plugins>
   </build>
 
+  <profiles>
+    <profile>
+      <id>git-info</id>
+      <activation>
+        <file>
+          <exists>.git</exists>
+        </file>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>pl.project13.maven</groupId>
+            <artifactId>git-commit-id-plugin</artifactId>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
 </project>