[
https://issues.apache.org/jira/browse/HADOOP-20000?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18138876#comment-18138876
]
ASF GitHub Bot commented on HADOOP-20000:
-----------------------------------------
joseluisll opened a new pull request, #8940:
URL: https://github.com/apache/hadoop/pull/8940
### Description of PR
Part of HADOOP-19912 (Jetty 12 on ee8).
`hadoop-yarn-server-timelineservice-hbase-tests` declared
`javax.ws.rs:jsr311-api:1.1.1`, the JAX-RS 1.1 API that Jersey 1 used, added by
YARN-5976 in 2016. The module also gets `jakarta.ws.rs:jakarta.ws.rs-api:2.1.6`
(JAX-RS 2.1, which ships the `javax.ws.rs` packages) at test scope through
`hadoop-yarn-server-timelineservice` and `jersey-server`. Both jars provided
`javax.ws.rs`, so which class won depended on classpath order. This drops the
1.1 jar.
The module has no `src/main`: it is a test jar. Its consumers are the
`hadoop-yarn-project` aggregator (`provided` scope) and `hadoop-coverage` (a
coverage-only module that is never published), neither of which compiles
against its classes; it is not passed on to any module. The distribution copies
only the module's own jar (`includeDependencies=false` in `hadoop-assemblies`).
No user-visible classpath changes.
The tests could not have been compiling against 1.1: `javax.ws.rs.client`
(used by `TimelineEntitySetReader` and its siblings) does not exist before
JAX-RS 2.0. So `jsr311-api` was redundant rather than shadowing 2.1 here, and
removing it changes no behaviour.
The removal is complete, not just the POM line: `git grep jsr311
> Remove the JAX-RS 1.1 API from hadoop-yarn-server-timelineservice-hbase-tests
> -----------------------------------------------------------------------------
>
> Key: HADOOP-20000
> URL: https://issues.apache.org/jira/browse/HADOOP-20000
> Project: Hadoop Common
> Issue Type: Sub-task
> Reporter: Jose Luis López
> Priority: Minor
>
> Sub-task of HADOOP-19912; follows HADOOP-19970.
> h3. Problem
> {{hadoop-yarn-server-timelineservice-hbase-tests}} declares
> {{javax.ws.rs:jsr311-api:1.1.1}}, the JAX-RS 1.1 API that Jersey 1 used. It
> was added by YARN-5976 (2016) for HBase 1.2. The same module also gets
> {{jakarta.ws.rs:jakarta.ws.rs-api:2.1.6}} (JAX-RS 2.1) through Jersey 2. Both
> jars provide the {{javax.ws.rs}} package, so the module's classpath carries
> two JAX-RS API versions, and which class wins depends on classpath order.
> HADOOP-19970 removes this kind of duplicate for Jetty and the servlet API.
> This does the same for JAX-RS.
> h3. Evidence
> {noformat}
> $ mvn dependency:tree -am -pl
> hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests
> -Dincludes=javax.ws.rs,jakarta.ws.rs
> org.apache.hadoop:hadoop-yarn-server-timelineservice-hbase-tests:jar:3.6.0-SNAPSHOT
> +-
> org.apache.hadoop:hadoop-yarn-server-timelineservice:jar:3.6.0-SNAPSHOT:test
> | \- jakarta.ws.rs:jakarta.ws.rs-api:jar:2.1.6:test
> \- javax.ws.rs:jsr311-api:jar:1.1.1:compile
> {noformat}
> The JAX-RS 2.1 API wins today only because it comes first in the dependency
> tree. The module's tests use JAX-RS 2 APIs, so {{jsr311-api}} appears unused.
> This is the only POM in the repository that declares it, and no other
> dependency of the module brings a JAX-RS 1.x API.
> h3. Change
> * Remove the {{jsr311-api}} dependency from the module's POM.
> * Check with {{mvn dependency:tree}} that no other path brings {{jsr311-api}}
> or another JAX-RS 1.x API onto the classpath. Exclude it there if one does.
> h3. Done when
> * {{javax.ws.rs:jsr311-api}} is on no module classpath of the trunk build.
> * The module's tests pass.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]