Publish fat JAR with platform-specific native libraries to Maven Central
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 35/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- Calme
- Domaine
- build-system, ci-cd, release
Piste de recherche
Commencez par examiner la configuration de build existante de JNI et Maven, puis exécutez mvn package pour comprendre la disposition actuelle des artefacts. Suivez la manière dont les bibliothèques natives peuvent être produites pour les quatre cibles indiquées et assemblées sous target/classes ; le travail est terminé lorsqu’un artefact unique de Maven Central charge la bibliothèque correspondante et que le release workflow la déploie avec des étapes documentées.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Java
- Étoiles
- 32
- Forks
- 12
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de apache/datafusion-java
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
apache/datafusion-java#116 ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
apache/datafusion-java#112 ·
-
enhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 42/100
apache/datafusion-java#96 ·
-
enhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 38/100
apache/datafusion-java#95 ·
-
Create first release Ouverteenhancement
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
apache/datafusion-java#86 · 3 commentaires ·
Toutes les issues de apache/datafusion-java
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
elastic/gradle-plugins#157 ·
-
enhancement Tools
Difficulté 1/5 Moins d'une heure Accessibilité débutants 75/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
apache/rocketmq-dashboard#5008 ·
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
DETECT_PARAMETER_NAMES=false silently disables @ConstructorProperties-based Creator detection too Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
FasterXML/jackson-databind#6229 ·