From d1b67c79e468f2a8680e913b7082f26c047773ae Mon Sep 17 00:00:00 2001 From: Wang Heng Date: Fri, 22 Sep 2023 10:57:22 +0800 Subject: [PATCH 1/2] docs(bindings/java): Added an example of adding dependencies using Gradle. --- bindings/java/README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/bindings/java/README.md b/bindings/java/README.md index 6523b00d47cc..6c1af928a838 100644 --- a/bindings/java/README.md +++ b/bindings/java/README.md @@ -9,6 +9,8 @@ This project is built upon the native OpenDAL lib. And it is released for multiple platforms that you can use a classifier to specify the platform you are building the application on. +### Maven + Generally, you can first add the `os-maven-plugin` for automatically detect the classifier based on your platform: ```xml @@ -39,6 +41,29 @@ Then add the dependency to `opendal-java` as following: ``` +### Gradle + +For Gradle you can first add the `com.google.osdetector` for automatically detect the classifier based on your platform: + +```groovy +plugins { + ... + id "com.google.osdetector" version "1.7.3" +} + +``` + +Then add the dependency to `opendal-java` as following: + +```groovy +dependencies { + ... + // OpenDAL + implementation "org.apache.opendal:opendal-java:0.40.0" + implementation "org.apache.opendal:opendal-java:0.40.0:$osdetector.classifier" +} +``` + Note that the dependency without classifier ships all classes and resources except the "opendal_java" shared library. And those with classifier bundle only the shared library. For downstream usage, it's recommended: From 17181a19a243a31503978b24a769ed09394023da Mon Sep 17 00:00:00 2001 From: tison Date: Fri, 22 Sep 2023 11:22:32 +0800 Subject: [PATCH 2/2] Update bindings/java/README.md --- bindings/java/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/bindings/java/README.md b/bindings/java/README.md index 6c1af928a838..c48d823d5f37 100644 --- a/bindings/java/README.md +++ b/bindings/java/README.md @@ -64,6 +64,7 @@ dependencies { } ``` +### Classified library Note that the dependency without classifier ships all classes and resources except the "opendal_java" shared library. And those with classifier bundle only the shared library. For downstream usage, it's recommended: