-
Notifications
You must be signed in to change notification settings - Fork 55
Maven arch-specific and nolib artifacts #447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+35
−6
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This change makes the following arch-specific artifacts to be deployed
to Maven Central (in addition to the main `duckdb_jdbc-x.x.x.x.jar` that
remains unchanged), classifiers:
- `linux_amd64`
- `linux_amd64_musl`
- `linux_arm64`
- `linux_arm64_musl`
- `macos_universal`
- `windows_amd64`
- `windows_arm64`
Each arch-specific artifact contains a native library only for this
particular platform and can be specified in Maven dependencies with the
following syntax:
```xml
<dependency>
<groupId>org.duckdb</groupId>
<artifactId>duckdb_jdbc</artifactId>
<version>1.x.x.x</version>
<classifier>linux_amd64_musl</classifier>
</dependency>
```
Note that Windows and Linux-musl AArch64 artifacts are renamed from
`aarch64` to `arm64` to align with wider DuckDB arch naming.
Additionally an artifact without any native library is deployed with a
`nolib` classifier. It is intended to be used with an externally
provided native library, see duckdb#421 for details.
staticlibs
added a commit
to staticlibs/duckdb-java
that referenced
this pull request
Nov 7, 2025
This PR is a continuation of duckdb#447 PR to allow using `duckdb_jdbc-x.x.x.x-nolib.jar` along with a JNI native library, that is loaded directly from file system. It extends the idea from duckdb#421 (and supersedes it) implementing the following logic: 1. if the driver JAR has a bundled native library (for current JVM os/arch), then this library will be unpacked to the temporary directory and loaded from there. If the library cannot be unpacked or loaded - there is no fallback to other methods (it is expected that `-nolib` JAR is used for other loading methods) 2. if the driver JAR does not hava a native library bundled inside it, then it will check whether a JNI native libary with the DuckDB internal naming (like `libduckdb_java.so_linux_amd64`) exists in file system next to the driver JAR (in the same directory). If library file is found there - then the driver will attempt to load it. If the file is found in file system, then it is expected that is can be loaded and there is no fallback to loading by name. 3. if the native lib is not found in the same directory, then, like in duckdb#421, the driver tries to load it using `duckdb_java` name (that will be translated by JVM to a platform-specific name like `libduckdb_java.so`). Testing: new test added that covers loading from the same dir and loading by name. Fixes: duckdb#444
This was referenced Nov 7, 2025
staticlibs
added a commit
to staticlibs/duckdb-java
that referenced
this pull request
Nov 10, 2025
This PR is a continuation of duckdb#447 PR to allow using `duckdb_jdbc-x.x.x.x-nolib.jar` along with a JNI native library, that is loaded directly from file system. It extends the idea from duckdb#421 (and supersedes it) implementing the following logic: 1. if the driver JAR has a bundled native library (for current JVM os/arch), then this library will be unpacked to the temporary directory and loaded from there. If the library cannot be unpacked or loaded - there is no fallback to other methods (it is expected that `-nolib` JAR is used for other loading methods) 2. if the driver JAR does not hava a native library bundled inside it, then it will try to load it with: ```java System.loadLibrary("duckdb_java"); ``` This call will search the library in `java.library.path` (using a platform-specific file name like `duckdb_java.dll`) or will use other methods defined by the host application. 3. if the native library cannot be loaded by name, then the driver will check whether a file with the DuckDB internal naming (like `libduckdb_java.so_linux_amd64`) exists in file system next to the driver JAR (in the same directory). If the library file is found there - then the driver will attempt to load it as the last resort. Testing: new test added that covers loading from the same dir and loading by name. Fixes: duckdb#444
staticlibs
added a commit
that referenced
this pull request
Nov 10, 2025
This PR is a continuation of #447 PR to allow using `duckdb_jdbc-x.x.x.x-nolib.jar` along with a JNI native library, that is loaded directly from file system. It extends the idea from #421 (and supersedes it) implementing the following logic: 1. if the driver JAR has a bundled native library (for current JVM os/arch), then this library will be unpacked to the temporary directory and loaded from there. If the library cannot be unpacked or loaded - there is no fallback to other methods (it is expected that `-nolib` JAR is used for other loading methods) 2. if the driver JAR does not hava a native library bundled inside it, then it will try to load it with: ```java System.loadLibrary("duckdb_java"); ``` This call will search the library in `java.library.path` (using a platform-specific file name like `duckdb_java.dll`) or will use other methods defined by the host application. 3. if the native library cannot be loaded by name, then the driver will check whether a file with the DuckDB internal naming (like `libduckdb_java.so_linux_amd64`) exists in file system next to the driver JAR (in the same directory). If the library file is found there - then the driver will attempt to load it as the last resort. Testing: new test added that covers loading from the same dir and loading by name. Fixes: #444
staticlibs
added a commit
to staticlibs/duckdb-java
that referenced
this pull request
Nov 10, 2025
This is a backport of the PR duckdb#447 to `v1.4-andium` stable branch. This change makes the following arch-specific artifacts to be deployed to Maven Central (in addition to the main `duckdb_jdbc-x.x.x.x.jar` that remains unchanged), classifiers: - `linux_amd64` - `linux_amd64_musl` - `linux_arm64` - `linux_arm64_musl` - `macos_universal` - `windows_amd64` - `windows_arm64` Each arch-specific artifact contains a native library only for this particular platform and can be specified in Maven dependencies with the following syntax: ```xml <dependency> <groupId>org.duckdb</groupId> <artifactId>duckdb_jdbc</artifactId> <version>1.x.x.x</version> <classifier>linux_amd64_musl</classifier> </dependency> ``` Note that Windows and Linux-musl AArch64 artifacts are renamed from `aarch64` to `arm64` to align with wider DuckDB arch naming. Additionally an artifact without any native library is deployed with a `nolib` classifier. It is intended to be used with an externally provided native library, see duckdb#421 for details.
staticlibs
added a commit
that referenced
this pull request
Nov 10, 2025
This is a backport of the PR #447 to `v1.4-andium` stable branch. This change makes the following arch-specific artifacts to be deployed to Maven Central (in addition to the main `duckdb_jdbc-x.x.x.x.jar` that remains unchanged), classifiers: - `linux_amd64` - `linux_amd64_musl` - `linux_arm64` - `linux_arm64_musl` - `macos_universal` - `windows_amd64` - `windows_arm64` Each arch-specific artifact contains a native library only for this particular platform and can be specified in Maven dependencies with the following syntax: ```xml <dependency> <groupId>org.duckdb</groupId> <artifactId>duckdb_jdbc</artifactId> <version>1.x.x.x</version> <classifier>linux_amd64_musl</classifier> </dependency> ``` Note that Windows and Linux-musl AArch64 artifacts are renamed from `aarch64` to `arm64` to align with wider DuckDB arch naming. Additionally an artifact without any native library is deployed with a `nolib` classifier. It is intended to be used with an externally provided native library, see #421 for details.
staticlibs
added a commit
to staticlibs/duckdb-java
that referenced
this pull request
Nov 10, 2025
This is a backport of the PR duckdb#450 to `v1.4-andium` stable branch. This PR is a continuation of duckdb#447 PR to allow using `duckdb_jdbc-x.x.x.x-nolib.jar` along with a JNI native library, that is loaded directly from file system. It extends the idea from duckdb#421 (and supersedes it) implementing the following logic: 1. if the driver JAR has a bundled native library (for current JVM os/arch), then this library will be unpacked to the temporary directory and loaded from there. If the library cannot be unpacked or loaded - there is no fallback to other methods (it is expected that `-nolib` JAR is used for other loading methods) 2. if the driver JAR does not hava a native library bundled inside it, then it will try to load it with: ```java System.loadLibrary("duckdb_java"); ``` This call will search the library in `java.library.path` (using a platform-specific file name like `duckdb_java.dll`) or will use other methods defined by the host application. 3. if the native library cannot be loaded by name, then the driver will check whether a file with the DuckDB internal naming (like `libduckdb_java.so_linux_amd64`) exists in file system next to the driver JAR (in the same directory). If the library file is found there - then the driver will attempt to load it as the last resort. Testing: new test added that covers loading from the same dir and loading by name. Fixes: duckdb#444
staticlibs
added a commit
that referenced
this pull request
Nov 10, 2025
This is a backport of the PR #450 to `v1.4-andium` stable branch. This PR is a continuation of #447 PR to allow using `duckdb_jdbc-x.x.x.x-nolib.jar` along with a JNI native library, that is loaded directly from file system. It extends the idea from #421 (and supersedes it) implementing the following logic: 1. if the driver JAR has a bundled native library (for current JVM os/arch), then this library will be unpacked to the temporary directory and loaded from there. If the library cannot be unpacked or loaded - there is no fallback to other methods (it is expected that `-nolib` JAR is used for other loading methods) 2. if the driver JAR does not hava a native library bundled inside it, then it will try to load it with: ```java System.loadLibrary("duckdb_java"); ``` This call will search the library in `java.library.path` (using a platform-specific file name like `duckdb_java.dll`) or will use other methods defined by the host application. 3. if the native library cannot be loaded by name, then the driver will check whether a file with the DuckDB internal naming (like `libduckdb_java.so_linux_amd64`) exists in file system next to the driver JAR (in the same directory). If the library file is found there - then the driver will attempt to load it as the last resort. Testing: new test added that covers loading from the same dir and loading by name. Fixes: #444
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change makes the following arch-specific artifacts to be deployed to Maven Central (in addition to the main
duckdb_jdbc-x.x.x.x.jarthat remains unchanged), classifiers:linux_amd64linux_amd64_musllinux_arm64linux_arm64_muslmacos_universalwindows_amd64windows_arm64Each arch-specific artifact contains a native library only for this
particular platform and can be specified in Maven dependencies with the
following syntax:
Note that Windows and Linux-musl AArch64 artifacts are renamed from
aarch64toarm64to align with wider DuckDB arch naming.Additionally an artifact without any native library is deployed with a
nolibclassifier. It is intended to be used with an externally provided native library, see #421 for details.