From 03005c72e2a29c9e1b10a46fd4f1cae932f8347b Mon Sep 17 00:00:00 2001
From: Tilman Hausherr <tilman@apache.org>
Date: Mon, 27 Jan 2025 09:55:58 +0100
Subject: [PATCH] TIKA-4327: use option to avoid exception in updated protobuf

---
 .../tika-parser-scientific-module/pom.xml                | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tika-parsers/tika-parsers-extended/tika-parser-scientific-module/pom.xml b/tika-parsers/tika-parsers-extended/tika-parser-scientific-module/pom.xml
index 4d7e4ee01e..3b108f0682 100644
--- a/tika-parsers/tika-parsers-extended/tika-parser-scientific-module/pom.xml
+++ b/tika-parsers/tika-parsers-extended/tika-parser-scientific-module/pom.xml
@@ -100,6 +100,15 @@ May the gods of dependency management fix this in the future.
 
   <build>
     <plugins>
+      <!-- because of protobuf 3.25.6. The actual problem is in netcdf4. Might be a false alarm,
+           because https://github.com/protocolbuffers/protobuf/security/advisories/GHSA-h4h5-3hr4-j3g2
+           mentions older versions of protobuf        -->
+      <plugin>
+          <artifactId>maven-surefire-plugin</artifactId>
+          <configuration>
+              <argLine>-Dcom.google.protobuf.use_unsafe_pre22_gencode</argLine>
+          </configuration>
+      </plugin>
       <plugin>
         <groupId>org.apache.rat</groupId>
         <artifactId>apache-rat-plugin</artifactId>