Publish fat JAR with platform-specific native libraries to Maven Central
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 領域
- build-system, ci-cd, release
調査の方向性
まず既存の JNI と Maven のビルド設定を調査し、次に mvn package を実行して現在のアーティファクトの配置を理解します。列挙された 4 つのターゲット向けにネイティブライブラリを生成し、target/classes 配下にまとめる方法を追跡します。完了条件は、単一の Maven Central アーティファクトが対応するライブラリを読み込み、release workflow が文書化された手順でそれをデプロイすることです。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Java
- スター
- 32
- フォーク
- 12
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/datafusion-java のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
apache/datafusion-java#116 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
apache/datafusion-java#112 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 42/100
apache/datafusion-java#96 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
apache/datafusion-java#95 ·
-
Create first release オープンenhancement
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
apache/datafusion-java#86 · コメント 3 件 ·
apache/datafusion-java の issue をすべて見る
似ている issue
-
bug untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
opensearch-project/ml-commons#5094 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
emitter:client:csharp feature
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
affects/8.10 affects/8.9 component/clients kind/bug likelihood/mid severity/mid
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 オープンbug frontend maui-pilot
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100