You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by ti...@apache.org on 2023/09/22 03:22:53 UTC
[incubator-opendal] branch main updated: docs(bindings/java): Added an example of adding dependencies using Gradle (#3158)
This is an automated email from the ASF dual-hosted git repository.
tison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
The following commit(s) were added to refs/heads/main by this push:
new 2d6c4c8af docs(bindings/java): Added an example of adding dependencies using Gradle (#3158)
2d6c4c8af is described below
commit 2d6c4c8afe1e51eb842fe21e653c5bb9cc46d347
Author: 王恒 <hi...@wangheng.me>
AuthorDate: Fri Sep 22 11:22:50 2023 +0800
docs(bindings/java): Added an example of adding dependencies using Gradle (#3158)
Co-authored-by: tison <wa...@gmail.com>
---
bindings/java/README.md | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/bindings/java/README.md b/bindings/java/README.md
index 6523b00d4..c48d823d5 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,30 @@ Then add the dependency to `opendal-java` as following:
</dependency>
```
+### 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"
+}
+```
+
+### 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: