diff --git a/README.md b/README.md index fa12075ab..b4d2ebd41 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Official Weaviate Java Client. ## Usage -To start using Weaviate Java Client add this dependency to `pom.xml`: +To start using Weaviate Java Client add the dependency to `pom.xml`: ```xml @@ -17,11 +17,17 @@ To start using Weaviate Java Client add this dependency to `pom.xml`: ``` -### For applications on Java 9 or above +### Uber JAR🫙 + +If you're building a uber-JAR with something like `maven-assembly-plugin`, use a shaded version with classifier `all`. +This ensures that all dynamically-loaded dependecies of `io.grpc` are resolved correctly. + + +### Gson and reflective access to internal JDK classes The client uses Google's [`gson`](https://github.com/google/gson) for JSON de-/serialization which does reflection on internal `java.lang` classes. This is _not allowed by default_ in Java 9 and above. -To work around this, it's necessary to add this JVM commandline argument: +To work around this, it's necessary to add this JVM command line argument: ``` --add-opens=java.base/java.lang=ALL-UNNAMED diff --git a/pom.xml b/pom.xml index 8576d7044..12c3d52fc 100644 --- a/pom.xml +++ b/pom.xml @@ -217,7 +217,6 @@ io.grpc:protoc-gen-grpc-java:1.58.0:exe:${os.detected.classifier} src/main/java false - @@ -445,6 +444,28 @@ maven-project-info-reports-plugin 3.1.1my + + + org.apache.maven.plugins + maven-shade-plugin + 3.6.0 + + false + true + all + + + + + + + package + + shade + + + + @@ -464,6 +485,10 @@ org.codehaus.mojo build-helper-maven-plugin + + org.apache.maven.plugins + maven-shade-plugin + org.apache.maven.plugins maven-javadoc-plugin