This is an automated email from the ASF dual-hosted git repository.
jiayu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sedona.git
The following commit(s) were added to refs/heads/master by this push:
new 6545ff3ab0 [GH-1945] Shade Jiffle and its dependencies (#1964)
6545ff3ab0 is described below
commit 6545ff3ab0a7b6df191ab3ffbdfc6ac4bb0a58c0
Author: Kristin Cowalcijk <[email protected]>
AuthorDate: Fri May 30 23:54:22 2025 +0800
[GH-1945] Shade Jiffle and its dependencies (#1964)
* Shade jiffle and its dependencies
* Fix lint warning
---
common/pom.xml | 85 ++++++++++++++++++++++++++++++++++++++++++++--------
pom.xml | 14 +++++++--
spark-shaded/pom.xml | 5 ++++
spark/common/pom.xml | 4 ---
4 files changed, 88 insertions(+), 20 deletions(-)
diff --git a/common/pom.xml b/common/pom.xml
index 36a99be252..8728a08bf7 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -105,19 +105,6 @@
<groupId>it.geosolutions.jaiext.jiffle</groupId>
<artifactId>jt-jiffle-language</artifactId>
</dependency>
- <!-- These test dependencies are for running map algebra tests -->
- <dependency>
- <groupId>org.antlr</groupId>
- <artifactId>antlr4-runtime</artifactId>
- <version>${antlr-runtime.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.codehaus.janino</groupId>
- <artifactId>janino</artifactId>
- <version>${janino-version}</version>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>edu.ucar</groupId>
<artifactId>cdm-core</artifactId>
@@ -134,6 +121,78 @@
<target>11</target>
</configuration>
</plugin>
+ <plugin>
+ <!-- Skip running resolved-pom-maven-plugin since shade will
+ generate dependency reduced pom which substitutes property
+ values. resolved-pom-maven-plugin will break pom
+ installation when working with maven-shade-plugin. -->
+ <groupId>io.paradoxical</groupId>
+ <artifactId>resolved-pom-maven-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>resolve-my-pom</id>
+ <phase>none</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <!--
+ We need to shade jiffle and its antlr and janino
dependencies for the following reasons:
+
+ 1. Databricks runtime uses an older version of janino
(3.0.16) that does not work
+ with jiffle in Spark repl. See
https://github.com/apache/sedona/discussions/1945
+
+ 2. Spark 4 uses an incompatible version of antlr at runtime.
+ -->
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <artifactSet>
+ <includes>
+
<include>it.geosolutions.jaiext.jiffle:*</include>
+ <include>org.antlr:*</include>
+ <include>org.codehaus.janino:*</include>
+ </includes>
+ </artifactSet>
+ <relocations>
+ <relocation>
+
<pattern>it.geosolutions.jaiext.jiffle</pattern>
+
<shadedPattern>org.apache.sedona.shaded.jiffle</shadedPattern>
+ <excludes>
+
<exclude>it.geosolutions.jaiext.jiffle.runtime.*</exclude>
+ </excludes>
+ </relocation>
+ <relocation>
+ <pattern>org.antlr.v4.runtime</pattern>
+
<shadedPattern>org.apache.sedona.shaded.antlr</shadedPattern>
+ </relocation>
+ <relocation>
+ <pattern>org.codehaus</pattern>
+
<shadedPattern>org.apache.sedona.shaded.codehaus</shadedPattern>
+ </relocation>
+ </relocations>
+ <filters>
+ <!-- filter to address "Invalid signature
file" issue - see http://stackoverflow.com/a/6743609/589215 -->
+ <filter>
+ <artifact>*:*</artifact>
+ <excludes>
+ <exclude>META-INF/*.SF</exclude>
+ <exclude>META-INF/*.DSA</exclude>
+ <exclude>META-INF/*.RSA</exclude>
+ </excludes>
+ </filter>
+ </filters>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</project>
diff --git a/pom.xml b/pom.xml
index 8a84a6cd48..ffe64586fa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -84,7 +84,7 @@
<scala.compat.version>2.12</scala.compat.version>
<spark.version>3.4.0</spark.version>
<spark.compat.version>3.4</spark.compat.version>
- <log4j.version>2.17.2</log4j.version>
+ <log4j.version>2.19.0</log4j.version>
<graphframe.version>0.8.3-spark3.4</graphframe.version>
<flink.version>1.19.0</flink.version>
@@ -272,12 +272,15 @@
<groupId>it.geosolutions.jaiext.jiffle</groupId>
<artifactId>jt-jiffle-language</artifactId>
<version>${jt-jiffle.version}</version>
- <scope>${geotools.scope}</scope>
<exclusions>
<exclusion>
- <groupId>*</groupId>
+ <groupId>javax.media</groupId>
<artifactId>*</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>it.geosolutions.jaiext.utilities</groupId>
+ <artifactId>jt-utilities</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -341,6 +344,11 @@
<version>4.0.2</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.codehaus.janino</groupId>
+ <artifactId>janino</artifactId>
+ <version>${janino-version}</version>
+ </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
diff --git a/spark-shaded/pom.xml b/spark-shaded/pom.xml
index 61fa40e258..145100f24c 100644
--- a/spark-shaded/pom.xml
+++ b/spark-shaded/pom.xml
@@ -47,6 +47,11 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>*</artifactId>
</exclusion>
+ <!-- Even those these are shaded, the shaded POM isn't used
when building projects in a single Maven run -->
+ <exclusion>
+ <groupId>it.geosolutions.jaiext.jiffle</groupId>
+ <artifactId>jt-jiffle-language</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
diff --git a/spark/common/pom.xml b/spark/common/pom.xml
index 13ed163a9d..6043b2fab8 100644
--- a/spark/common/pom.xml
+++ b/spark/common/pom.xml
@@ -162,10 +162,6 @@
<groupId>org.geotools</groupId>
<artifactId>gt-arcgrid</artifactId>
</dependency>
- <dependency>
- <groupId>it.geosolutions.jaiext.jiffle</groupId>
- <artifactId>jt-jiffle-language</artifactId>
- </dependency>
<dependency>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-core</artifactId>