My project depends on javax.ws.rs-api:2.0.1 and hadoop-mapreduce-client-core:3.1.0 which in turn depends on jsr311-api:1.1.1.
My project
-> javax.ws.rs-api:2.0.1
-> hadoop-mapreduce-client-core:3.1.0
-> jsr311-api:1.1.1
The problem is that class javax.ws.rs.core.Response is included in both javax.ws.rs-api:2.0.1 and jsr311-api:1.1.1, but they have different method signatures. When compiling the project, Maven tried to find the readEntity(Class<T> entityType) method in jsr311-api instead of javax.ws.rs-api, which caused NoSuchMethodError.
I solved this problem by excluding jsr311-api from dependency hadoop-mapreduce-client-core. But I want to understand why Maven tries to use jsr311-api? Is there a dependency classpath? How can I find it?
PS: I know the mechanism of Maven to resolve dependency conflict between different versions of the same artifact, but this problem is different.