From 1289a5a0bc6d18022f022d2ca04173af5abcd020 Mon Sep 17 00:00:00 2001
From: Brandon Clayton <bclayton@usgs.gov>
Date: Tue, 26 Apr 2022 10:10:26 -0600
Subject: [PATCH 1/3] do not apply plugin

---
 build.gradle | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.gradle b/build.gradle
index 684942bb1..9dd53b0a2 100644
--- a/build.gradle
+++ b/build.gradle
@@ -33,7 +33,7 @@ plugins {
   id "com.github.johnrengelman.shadow" version "${shadowVersion}"
   id "com.github.node-gradle.node" version "${nodePluginVersion}"
   id "com.github.spotbugs" version "${spotbugsVersion}"
-  id "com.palantir.git-version" version "${gitVersionVersion}"
+  id "com.palantir.git-version" version "${gitVersionVersion}" apply false
   id "com.star-zero.gradle.githook" version "${githooksVersion}"
   id "eclipse-wtp"
   id "io.micronaut.application" version "${micronautPluginVersion}"
-- 
GitLab


From f52282b681fdc013ebb94aab39a4163ec351ddbc Mon Sep 17 00:00:00 2001
From: Brandon Clayton <bclayton@usgs.gov>
Date: Tue, 26 Apr 2022 10:10:50 -0600
Subject: [PATCH 2/3] apply plugin in try catch block

---
 gradle/app-version.gradle | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gradle/app-version.gradle b/gradle/app-version.gradle
index f7e96ed1e..47452e9a3 100644
--- a/gradle/app-version.gradle
+++ b/gradle/app-version.gradle
@@ -1,8 +1,9 @@
-apply plugin: "com.palantir.git-version"
 
 tasks.withType(JavaCompile) {
   doFirst {
     try {
+      apply plugin: "com.palantir.git-version"
+
       def versionFile = new File("${projectDir}/src/main/resources/version/nshmp-haz-version.json")
       new File(versionFile.getParent()).mkdirs()
       def details = versionDetails()
@@ -23,6 +24,7 @@ tasks.withType(JavaCompile) {
       versionFile.write(groovy.json.JsonOutput.prettyPrint(json))
     } catch (Exception e) {
       println("Failed to create version file.")
+      throw new Exception(e)
     }
   }
 }
-- 
GitLab


From 9bf87f57414e58ced2ca94a42140fe453c04e89a Mon Sep 17 00:00:00 2001
From: Brandon Clayton <bclayton@usgs.gov>
Date: Tue, 26 Apr 2022 10:21:33 -0600
Subject: [PATCH 3/3] remove throw exception

---
 gradle/app-version.gradle | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gradle/app-version.gradle b/gradle/app-version.gradle
index 47452e9a3..c0f4c3c4c 100644
--- a/gradle/app-version.gradle
+++ b/gradle/app-version.gradle
@@ -24,7 +24,6 @@ tasks.withType(JavaCompile) {
       versionFile.write(groovy.json.JsonOutput.prettyPrint(json))
     } catch (Exception e) {
       println("Failed to create version file.")
-      throw new Exception(e)
     }
   }
 }
-- 
GitLab