Publish fat JAR with platform-specific native libraries to Maven Central
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Ruhig
- Bereich
- build-system, ci-cd, release
Rechercherichtung
Beginne mit der Untersuchung der vorhandenen JNI- und Maven-Build-Konfiguration und führe anschließend mvn package aus, um das aktuelle Layout der Artefakte zu verstehen. Verfolge, wie native Bibliotheken für die vier aufgeführten Ziele erzeugt und unter target/classes zusammengestellt werden können; abgeschlossen ist die Aufgabe, wenn ein einzelnes Maven-Central-Artefakt die passende Bibliothek lädt und der Release-Workflow sie mit dokumentierten Schritten bereitstellt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Background
datafusion-java provides a JVM binding to DataFusion via JNI. To distribute it through Maven Central, we need a packaging strategy that delivers the compiled Rust native library (.so / .dylib / .dll) alongside the Java classes so that consumers get a working artifact with a single dependency declaration — no separate native install step.
Goal
Publish a single artifact to Maven Central that works out of the box on:
- Linux x86_64
- Linux aarch64
- macOS x86_64
- macOS aarch64
Windows (x86_64) support is desirable but out of scope for the initial release. The design should leave room to add it later without restructuring.
Proposed approach: single fat JAR
Bundle all platform-specific native libraries in one published JAR, organized by OS/arch under a known resource path:
org/apache/datafusion/linux/amd64/libdatafusion_jni.so
org/apache/datafusion/linux/aarch64/libdatafusion_jni.so
org/apache/datafusion/darwin/x86_64/libdatafusion_jni.dylib
org/apache/datafusion/darwin/aarch64/libdatafusion_jni.dylib
At runtime, a loader class detects the current OS/arch, extracts the matching library from the JAR to a temp file, and calls System.load() on the absolute path. A System.loadLibrary() attempt should come first so users can override with a system-installed build.
This mirrors the approach used by Apache DataFusion Comet (referenced only as prior art for fat-JAR packaging — datafusion-java is not otherwise related to Comet or Spark). The alternative — publishing one JAR per platform with Maven classifiers — is also viable but pushes platform selection onto consumers and complicates dependency declarations.
Work items
- Add a native loader class that detects OS/arch, extracts from the resource path, and loads via
System.load(), with aSystem.loadLibrary()fallback. Include temp-file locking to handle concurrent JVMs. - Set up cross-compilation for the four target triples (Linux x86_64, Linux aarch64, macOS x86_64, macOS aarch64). Options: a CI matrix that produces per-arch artifacts, or Docker + OSXCross for cross-platform builds from a single host.
- Wire the build so compiled libraries land at the correct
target/classes/...path beforemvn packageruns. - Add a GitHub Actions release workflow: matrix builds per platform produce native libs as artifacts; a final job assembles them into the resource tree and runs
mvn deploy. - Configure Maven Central / Sonatype publishing: staging repo, GPG signing, POM metadata.
- Document the release process.
Future work
- Windows x86_64 support. The loader OS enum should already account for
.dlland thewin32path segment so this becomes a build-matrix change. Windows complicates temp-file cleanup (can't delete a loaded DLL) — extract to a versioned path and let the OS handle cleanup.
- Vorherrschende Sprache
- Java
- Sterne
- 32
- Forks
- 12
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus apache/datafusion-java
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
apache/datafusion-java#116 ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
apache/datafusion-java#112 ·
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 42/100
apache/datafusion-java#96 ·
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 38/100
apache/datafusion-java#95 ·
-
Create first release Offenenhancement
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
apache/datafusion-java#86 · 3 Kommentare ·
Alle Issues in apache/datafusion-java
Ähnliche Issues
-
bug untriaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
opensearch-project/ml-commons#5094 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
-
emitter:client:csharp feature
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
affects/8.10 affects/8.9 component/clients kind/bug likelihood/mid severity/mid
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 Offenbug frontend maui-pilot
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100