This is an automated email from the ASF dual-hosted git repository.

lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git


The following commit(s) were added to refs/heads/main by this push:
     new 0c426d347 build(java/driver/jni): don't include JNI binaries in 
sources JAR (#4664)
0c426d347 is described below

commit 0c426d34786324d877ea3f0ea618a99103cab006
Author: David Li <[email protected]>
AuthorDate: Mon Aug 10 07:49:14 2026 +0900

    build(java/driver/jni): don't include JNI binaries in sources JAR (#4664)
    
    Closes #3691.
    
    Assisted-by: GPT-5.6 Sol <[email protected]>
---
 .github/workflows/packaging.yml | 18 ++++++++++++++++++
 java/driver/jni/pom.xml         |  9 +++++++++
 2 files changed, 27 insertions(+)

diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml
index 596addbbb..71d91e464 100644
--- a/.github/workflows/packaging.yml
+++ b/.github/workflows/packaging.yml
@@ -359,6 +359,24 @@ jobs:
           popd
           cp -a adbc/dist/ ./
 
+      # Basic sanity check; also don't ship binaries in sources JAR to avoid 
bloat
+      - name: Verify JNI JAR contents
+        run: |
+          sources_jar=$(find dist -maxdepth 1 -name 
'adbc-driver-jni-*-sources.jar' -print -quit)
+          runtime_jar=${sources_jar%-sources.jar}.jar
+
+          jar tf "${sources_jar}" > temp_jni_sources_contents.txt
+          if grep -q '^adbc_driver_jni/' temp_jni_sources_contents.txt; then
+            echo "JNI source JAR contains native binaries: ${sources_jar}"
+            exit 1
+          fi
+
+          jar tf "${runtime_jar}" > temp_jni_runtime_contents.txt
+          if ! grep -q '^adbc_driver_jni/' temp_jni_runtime_contents.txt; then
+            echo "JNI runtime JAR does not contain native binaries: 
${runtime_jar}"
+            exit 1
+          fi
+
       - name: Archive JARs
         uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a 
# v7.0.1
         with:
diff --git a/java/driver/jni/pom.xml b/java/driver/jni/pom.xml
index 27452fe94..fdf6ec647 100644
--- a/java/driver/jni/pom.xml
+++ b/java/driver/jni/pom.xml
@@ -81,6 +81,15 @@
 
   <build>
     <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-source-plugin</artifactId>
+        <configuration>
+          <excludes>
+            <exclude>adbc_driver_jni/**</exclude>
+          </excludes>
+        </configuration>
+      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>

Reply via email to