Copilot commented on code in PR #882:
URL: https://github.com/apache/ranger/pull/882#discussion_r2969064211
##########
distro/src/main/assembly/plugin-ozone.xml:
##########
@@ -108,9 +107,8 @@
<include>org.apache.solr:solr-solrj:jar:${solr.version}</include>
<include>com.fasterxml.woodstox:woodstox-core:jar:${fasterxml.woodstox.version}</include>
<include>org.codehaus.woodstox:stax2-api:jar:${codehaus.woodstox.stax2api.version}</include>
- <include>com.sun.jersey:jersey-core</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>
Review 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.
```suggestion
<include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include>
<include>javax.ws.rs:jsr311-api:jar:${jsr311-api.version}</include>
```
##########
distro/src/main/assembly/plugin-atlas.xml:
##########
@@ -60,7 +60,8 @@
<fileMode>644</fileMode>
<includes>
<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>
Review 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.
```suggestion
<include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include>
<include>javax.ws.rs:jsr311-api</include>
```
##########
agents-common/pom.xml:
##########
@@ -74,14 +74,13 @@
</dependency>
<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>
Review 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.
##########
distro/src/main/assembly/plugin-trino.xml:
##########
@@ -87,8 +85,9 @@
<include>org.apache.ranger:credentialbuilder</include>
<include>org.codehaus.woodstox:stax2-api</include>
<include>com.fasterxml.woodstox:woodstox-core</include>
- <include>com.sun.jersey:jersey-bundle</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>
Review 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`).
```suggestion
<include>com.sun.jersey:jersey-json:jar:${jersey-bundle.version}</include>
<include>javax.ws.rs:jsr311-api:jar:${jsr311-api.version}</include>
```
##########
distro/src/main/assembly/plugin-presto.xml:
##########
@@ -95,8 +93,9 @@
<include>org.apache.ranger:credentialbuilder</include>
<include>org.codehaus.woodstox:stax2-api</include>
<include>com.fasterxml.woodstox:woodstox-core</include>
- <include>com.sun.jersey:jersey-bundle</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>
Review 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`).
```suggestion
<include>com.sun.jersey:jersey-json:jar:${jersey-bundle.version}</include>
<include>javax.ws.rs:jsr311-api:jar:${jsr311-api.version}</include>
```
##########
distro/src/main/assembly/storm-agent.xml:
##########
@@ -142,7 +142,8 @@
<directoryMode>755</directoryMode>
<fileMode>644</fileMode>
<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>
Review 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.
```suggestion
<include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include>
<include>javax.ws.rs:jsr311-api:jar:${jsr311-api.version}</include>
```
##########
hbase-agent/pom.xml:
##########
@@ -57,12 +57,6 @@
<artifactId>jersey-client</artifactId>
<version>${jersey-bundle.version}</version>
<type>jar</type>
Review Comment:
`jersey-core` still excludes `javax.ws.rs:jsr311-api`, but `jersey-client`
no longer does. This makes the exclusion ineffective/inconsistent (jsr311-api
can still be pulled transitively via `jersey-client`). Either apply the same
exclusion to `jersey-client` as well, or remove the exclusion and add a single
explicit `jsr311-api` dependency at the desired version.
```suggestion
<type>jar</type>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
</exclusion>
</exclusions>
```
##########
distro/src/main/assembly/plugin-elasticsearch.xml:
##########
@@ -71,7 +71,8 @@
<include>org.apache.hadoop:hadoop-client-runtime:jar:${hadoop.version}</include>
<include>com.google.code.gson:gson</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>
Review 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.
```suggestion
<include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include>
<include>javax.ws.rs:jsr311-api:jar:${jsr311-api.version}</include>
```
##########
distro/src/main/assembly/plugin-kafka.xml:
##########
@@ -64,7 +64,8 @@
<include>com.google.code.gson:gson</include>
<include>org.eclipse.jetty:jetty-client:jar:${jetty-client.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>
Review 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.
```suggestion
<include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include>
<include>javax.ws.rs:jsr311-api:jar:${jsr311-api.version}</include>
```
##########
distro/src/main/assembly/plugin-ozone.xml:
##########
@@ -51,9 +51,8 @@
<includes>
<include>com.fasterxml.woodstox:woodstox-core:jar:${fasterxml.woodstox.version}</include>
<include>com.kstruct:gethostname4j</include>
- <include>com.sun.jersey:jersey-bundle</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>
Review 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.
```suggestion
<include>com.sun.jersey:jersey-core:jar:${jersey-bundle.version}</include>
<include>javax.ws.rs:jsr311-api:jar:${jsr311-api.version}</include>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]