From d20abad41c2214d7ad9138c1fb5c1a61291ad937 Mon Sep 17 00:00:00 2001 From: Nick Dimiduk Date: Fri, 7 May 2021 11:37:48 -0700 Subject: [PATCH 1/2] HBASE-25863 [hbase-thirdparty] Shade javax.ws.rs package for use with shaded Jersey From the [About](https://eclipse-ee4j.github.io/jersey/) text, > Jersey RESTful Web Services 2.x framework is open source, production quality, framework for > developing RESTful Web Services in Java that provides support for JAX-RS APIs and serves as a > JAX-RS (JSR 311 & JSR 339 & JSR 370) Reference Implementation. `javax.ws.rs` is defined by the JSRs, so it doesn't make sense that we could have multiple implementations of that JSR on the classpath simultaniously (via jersey-server-1.x and jersey-server-2.x jars) without them colliding. By shading over the JSR package space in the jersey-server-2.x implementation jars, we achieve a completely isolated JSR runtime. Signed-off-by: Sean Busbey Signed-off-by: Andrew Purtell --- hbase-shaded-jersey/pom.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hbase-shaded-jersey/pom.xml b/hbase-shaded-jersey/pom.xml index 92c485c..92b8b7b 100644 --- a/hbase-shaded-jersey/pom.xml +++ b/hbase-shaded-jersey/pom.xml @@ -68,6 +68,10 @@ true true + + javax.ws.rs + ${rename.offset}.javax.ws.rs + org.glassfish ${rename.offset}.org.glassfish @@ -96,7 +100,6 @@ also else we give an odd signal in the META-INF/DEPENDENCIES that we produce. See below for how to exclusion of transitive dependencies. --> - jakarta.ws.rs:jakarta.ws.rs-api jakarta.annotation:jakarta.annotation-api jakarta.validation:jakarta.validation-api org.glassfish.hk2.external:jakarta.inject From f902b252f2d59d2d24b03e657d4fafaaced2fb80 Mon Sep 17 00:00:00 2001 From: Nick Dimiduk Date: Fri, 7 May 2021 15:18:53 -0700 Subject: [PATCH 2/2] HBASE-25868 [hbase-thirdparty] Shade jackson-jaxrs-json-provider for use with shaded jersey Make this provider module compatible with our shaded Jersey. Signed-off-by: Sean Busbey Signed-off-by: Andrew Purtell --- .../pom.xml | 113 ++++++++++++++++++ pom.xml | 2 + 2 files changed, 115 insertions(+) create mode 100644 hbase-shaded-jackson-jaxrs-json-provider/pom.xml diff --git a/hbase-shaded-jackson-jaxrs-json-provider/pom.xml b/hbase-shaded-jackson-jaxrs-json-provider/pom.xml new file mode 100644 index 0000000..c79af04 --- /dev/null +++ b/hbase-shaded-jackson-jaxrs-json-provider/pom.xml @@ -0,0 +1,113 @@ + + + + 4.0.0 + + org.apache.hbase.thirdparty + hbase-thirdparty + 4.0.0-SNAPSHOT + .. + + hbase-shaded-jackson-jaxrs-json-provider + Apache HBase Relocated (Shaded) jackson-jaxrs-json-provider + + Pulls down jackson-jaxrs-json-provider, relocates it, and rewrites its usage of javax.ws.rs + classes to make the relocated versions provided by hbase-shaded-jersey. Does NOT + include/relocate its entire dependency graph, just performs this isolated transform. + + This is a separate module because jackson-jaxrs-json-provider is not used universally. At + this time, the dependency is required only by hbase-rest. + + + + + maven-clean-plugin + + + + ${basedir} + + dependency-reduced-pom.xml + + + + + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + true + true + true + + + javax.ws.rs + ${rename.offset}.javax.ws.rs + + + com.fasterxml.jackson.jaxrs + ${rename.offset}.com.fasterxml.jackson.jaxrs + + + + + com.fasterxml.jackson.jaxrs:jackson-jaxrs-base + com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider + + + + + + + false + + + + + + + + + + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-jaxrs-json-provider.version} + + + diff --git a/pom.xml b/pom.xml index 9ca725c..b2014b9 100644 --- a/pom.xml +++ b/pom.xml @@ -59,6 +59,7 @@ hbase-shaded-miscellaneous hbase-shaded-jetty hbase-shaded-jersey + hbase-shaded-jackson-jaxrs-json-provider hbase-noop-htrace @@ -144,6 +145,7 @@ 1.3.5 2.0.2 3.25.0-GA + 2.10.1