RANGER-5523: replace jersey-bundle dependency with jersey-client and jersey-core in plugins#882
RANGER-5523: replace jersey-bundle dependency with jersey-client and jersey-core in plugins#882mneethiraj wants to merge 2 commits intoapache:masterfrom
Conversation
…jersey-core in plugins
There was a problem hiding this comment.
Pull request overview
Updates Ranger plugin packaging to avoid using the monolithic Jersey 1 jersey-bundle by switching to more granular Jersey artifacts, while also making several assembly descriptors pin Jersey coordinates explicitly.
Changes:
- Add a new
${jsr311-api.version}property at the root build level. - Replace
com.sun.jersey:jersey-bundlewithcom.sun.jersey:jersey-client+com.sun.jersey:jersey-corein some plugin/module dependency and assembly definitions. - Update multiple distro assembly descriptors to use explicit
groupId:artifactId:jar:versioncoordinates for Jersey artifacts.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| pom.xml | Adds jsr311-api.version property for packaging/assembly use. |
| agents-common/pom.xml | Replaces jersey-bundle with jersey-client + jersey-core in shared plugin common deps. |
| hbase-agent/pom.xml | Removes jsr311-api exclusion from jersey-client while keeping it on jersey-core. |
| distro/src/main/assembly/usersync.xml | Pins jersey-bundle include to an explicit jar/version coordinate. |
| distro/src/main/assembly/storm-agent.xml | Switches Storm agent packaging from jersey-bundle to jersey-client + jersey-core. |
| distro/src/main/assembly/sample-client.xml | Pins jersey-bundle include to an explicit jar/version coordinate. |
| distro/src/main/assembly/ranger-tools.xml | Pins jersey-bundle include to an explicit jar/version coordinate. |
| distro/src/main/assembly/plugin-trino.xml | Removes server-related Jersey includes and adds jersey-client + jersey-core (+ jersey-json). |
| distro/src/main/assembly/plugin-presto.xml | Removes server-related Jersey includes and adds jersey-client + jersey-core (+ jersey-json). |
| distro/src/main/assembly/plugin-ozone.xml | Replaces prior Jersey includes with jersey-client + jersey-core in multiple dependency lists. |
| distro/src/main/assembly/plugin-kafka.xml | Replaces jersey-bundle with jersey-client + jersey-core in plugin impl packaging. |
| distro/src/main/assembly/plugin-elasticsearch.xml | Replaces jersey-bundle with jersey-client + jersey-core in plugin impl packaging. |
| distro/src/main/assembly/plugin-atlas.xml | Replaces jersey-bundle with jersey-client + jersey-core in plugin impl packaging. |
| distro/src/main/assembly/plugin-solr.xml | Replaces jersey-bundle with jersey-client + jersey-core and explicitly includes jsr311-api. |
| distro/src/main/assembly/kms.xml | Pins jersey-bundle include to an explicit jar/version coordinate. |
| distro/src/main/assembly/admin-web.xml | Adds an explicit jersey-bundle include to the embedded webserver lib set. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <includes> | ||
| <include>com.sun.jersey:jersey-bundle:jar:${jersey-bundle.version}</include> | ||
| <include>com.sun.jersey:jersey-client:jar:${jersey-bundle.version}</include> | ||
| <include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include> |
There was a problem hiding this comment.
This dependencySet includes jersey-client/jersey-core but no explicit JAX-RS API jar. Since the storm plugin depends on ranger-plugins-common (which imports javax.ws.rs.*), add javax.ws.rs:jsr311-api:jar:${jsr311-api.version} here (or ensure an equivalent API jar is included in one of the dependencySets) to prevent runtime CNFEs.
| <include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include> | |
| <include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include> | |
| <include>javax.ws.rs:jsr311-api:jar:${jsr311-api.version}</include> |
| <include>commons-collections:commons-collections</include> | ||
| <include>com.sun.jersey:jersey-bundle</include> | ||
| <include>com.sun.jersey:jersey-client:jar:${jersey-bundle.version}</include> | ||
| <include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include> |
There was a problem hiding this comment.
After replacing jersey-bundle with jersey-client/jersey-core, this include list no longer guarantees a javax.ws.rs API jar is packaged. Since ranger-plugins-common uses javax.ws.rs.*, consider adding an explicit include for javax.ws.rs:jsr311-api:jar:${jsr311-api.version} (like plugin-solr.xml) to keep the plugin distribution self-contained.
| <include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include> | |
| <include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include> | |
| <include>javax.ws.rs:jsr311-api:jar:${jsr311-api.version}</include> |
| <include>com.sun.jersey:jersey-client</include> | ||
| <include>com.sun.jersey:jersey-bundle</include> | ||
| <include>com.sun.jersey:jersey-client:jar:${jersey-bundle.version}</include> | ||
| <include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include> |
There was a problem hiding this comment.
This plugin-impl dependency list includes jersey-client/jersey-core but does not explicitly include a JAX-RS API jar. Since plugin code depends on javax.ws.rs.*, add javax.ws.rs:jsr311-api:jar:${jsr311-api.version} (as in plugin-solr.xml) or ensure an equivalent API jar is included elsewhere in the assembly.
| <include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include> | |
| <include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include> | |
| <include>javax.ws.rs:jsr311-api:jar:${jsr311-api.version}</include> |
| <include>com.sun.jersey:jersey-json</include> | ||
| <include>com.sun.jersey:jersey-client:jar:${jersey-bundle.version}</include> | ||
| <include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include> | ||
| <include>com.sun.jersey:jersey-json:jar:${jersey-bundle.version}</include> |
There was a problem hiding this comment.
This plugin assembly now lists Jersey artifacts individually. To avoid missing JAX-RS API classes at runtime (used by ranger-plugins-common), add an explicit include for javax.ws.rs:jsr311-api:jar:${jsr311-api.version} alongside the Jersey includes (similar to plugin-solr.xml).
| <include>com.sun.jersey:jersey-json:jar:${jersey-bundle.version}</include> | |
| <include>com.sun.jersey:jersey-json:jar:${jersey-bundle.version}</include> | |
| <include>javax.ws.rs:jsr311-api:jar:${jsr311-api.version}</include> |
| <dependency> | ||
| <groupId>com.sun.jersey</groupId> | ||
| <artifactId>jersey-bundle</artifactId> | ||
| <artifactId>jersey-client</artifactId> | ||
| <version>${jersey-bundle.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.sun.jersey</groupId> | ||
| <artifactId>jersey-core</artifactId> | ||
| <version>${jersey-bundle.version}</version> | ||
| <exclusions> | ||
| <exclusion> | ||
| <groupId>javax.ws.rs</groupId> | ||
| <artifactId>jsr311-api</artifactId> | ||
| </exclusion> | ||
| </exclusions> | ||
| </dependency> |
There was a problem hiding this comment.
In this module you replaced jersey-bundle with jersey-client/jersey-core, but the prior setup excluded javax.ws.rs:jsr311-api (see other modules like kms/pom.xml). Consider explicitly managing the JAX-RS API instead of inheriting it transitively: either add jsr311-api as a direct dependency (using the new ${jsr311-api.version}) or re-add exclusions on both Jersey dependencies to avoid pulling an unexpected JAX-RS API version into downstream plugins.
| <include>commons-collections:commons-collections</include> | ||
| <include>com.sun.jersey:jersey-bundle</include> | ||
| <include>com.sun.jersey:jersey-client:jar:${jersey-bundle.version}</include> | ||
| <include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include> |
There was a problem hiding this comment.
This plugin assembly now includes jersey-client/jersey-core but does not explicitly include a JAX-RS API jar. Since ranger-plugins-common code imports javax.ws.rs.*, ensure javax.ws.rs:jsr311-api is included in this dependency set (similar to plugin-solr.xml) so the plugin package is self-contained.
| <include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include> | |
| <include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include> | |
| <include>javax.ws.rs:jsr311-api</include> |
| <include>org.eclipse.jetty:jetty-client:jar:${jetty-client.version}</include> | ||
| <include>com.sun.jersey:jersey-bundle</include> | ||
| <include>com.sun.jersey:jersey-client:jar:${jersey-bundle.version}</include> | ||
| <include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include> |
There was a problem hiding this comment.
This assembly switches from jersey-bundle to jersey-client/jersey-core, but there is no explicit include for a JAX-RS API jar. Because plugin code (via ranger-plugins-common) references javax.ws.rs.*, add javax.ws.rs:jsr311-api:jar:${jsr311-api.version} to the includes (as done in plugin-solr.xml) to avoid runtime CNFEs in environments that don't already provide the API.
| <include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include> | |
| <include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include> | |
| <include>javax.ws.rs:jsr311-api:jar:${jsr311-api.version}</include> |
| <include>com.sun.jersey:jersey-core</include> | ||
| <include>com.sun.jersey:jersey-client</include> | ||
| <include>com.sun.jersey:jersey-client:jar:${jersey-bundle.version}</include> | ||
| <include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include> |
There was a problem hiding this comment.
This dependencySet now includes only jersey-client/jersey-core and does not explicitly include a JAX-RS API jar. Given ranger-plugins-common references javax.ws.rs.*, add javax.ws.rs:jsr311-api:jar:${jsr311-api.version} here (or otherwise ensure the API jar is included) to avoid runtime classloading failures.
| <include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include> | |
| <include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include> | |
| <include>javax.ws.rs:jsr311-api:jar:${jsr311-api.version}</include> |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 25 out of 25 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <include>com.fasterxml.jackson.core:jackson-annotations:jar:${fasterxml.jackson.version}</include> | ||
| <include>com.fasterxml.jackson.core:jackson-core:jar:${fasterxml.jackson.version}</include> | ||
| <include>com.fasterxml.jackson.core:jackson-databind:jar:${fasterxml.jackson.version}</include> |
There was a problem hiding this comment.
The Trino plugin assembly now includes jersey-client/jersey-core (and jersey-json) but does not include javax.ws.rs:jsr311-api. Since the assembly uses an explicit <includes> filter, the resulting tarball may not contain the javax.ws.rs.* API classes required by Jersey 1.x. Add an explicit include for jsr311-api using ${jsr311-api.version}.
| <include>com.fasterxml.jackson.core:jackson-annotations:jar:${fasterxml.jackson.version}</include> | |
| <include>com.fasterxml.jackson.core:jackson-core:jar:${fasterxml.jackson.version}</include> | |
| <include>com.fasterxml.jackson.core:jackson-databind:jar:${fasterxml.jackson.version}</include> |
What changes were proposed in this pull request?
(Please fill in changes proposed in this fix. Create an issue in ASF JIRA before opening a pull request and
set the title of the pull request which starts with
the corresponding JIRA issue number. (e.g. RANGER-XXXX: Fix a typo in YYY))
How was this patch tested?