From 8b4e50d10a9121334be3d8b5ed0d8fc9ff63c182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Mon, 1 Feb 2021 00:31:48 +0100 Subject: [PATCH] feat: support creating shaded jars (#333) Some applications that load multiple JDBC drivers may run into dependency conflicts if other JDBC drivers use the same dependencies but different versions. This problem can be mitigated by creating a jar with shaded dependencies. This change adds a Maven profile for creating shaded jars. Fixes #316 --- .readme-partials.yaml | 11 +++++++++++ pom.xml | 44 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/.readme-partials.yaml b/.readme-partials.yaml index 47e65e14..c407ffc2 100644 --- a/.readme-partials.yaml +++ b/.readme-partials.yaml @@ -23,3 +23,14 @@ custom_content: | } } ``` + + ### Creating a Shaded Jar + + A jar with all dependencies included is automatically generated when you execute `mvn package`. + The dependencies in this jar are not shaded. To create a jar with shaded dependencies you must + activate the `shade` profile like this: + + ``` + mvn package -Pshade + ``` + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 173c0a84..b971e4e5 100644 --- a/pom.xml +++ b/pom.xml @@ -309,6 +309,50 @@ + + + + shade + + + + org.apache.maven.plugins + maven-shade-plugin + + + + com + com.google.cloud.spanner.jdbc.shaded.com + + com.google.cloud.spanner.** + + + + android + com.google.cloud.spanner.jdbc.shaded.android + + + io + com.google.cloud.spanner.jdbc.shaded.io + + io.grpc.netty.shaded.** + + + + org + com.google.cloud.spanner.jdbc.shaded.org + + org.conscrypt.** + + + + + + + + + +