泽西依赖冲突

Jersey dependency conflict

我正在现有项目的基础上实施 dropwizard 服务器应用程序。用 Maven 构建。

我现在正处于罐子地狱,这并不好玩。我有一个相当复杂的 pom 文件。我对用 hadoop/glassfish/com.sun 打包的 jersey 依赖项有一个大问题。 com.sun.jersey:jersey-core:jar1.19org.glassfish.jersey.core:jersey-client:jar:2.22.2 冲突。我尝试添加一些排除项以使其使用 2.22.x 版本,但它仍然给我看到的错误 . I've been combing through the dependency tree and adding exclusions where I see fit, but can't seem to get it right. Here is my pom file.

个人经验告诉我,如果你有旧球衣版本作为依赖项,你应该检查所有依赖项(尤其是你内部开发的依赖项)。

这就是为我解决了类似的问题。

如果你这样做:

mvn dependency:list -详细 (grep 过滤结果)

它为您提供了依赖项列表(也包括传递性列表)。检查您的应用程序中使用的 sun jersey 或 glassfish jersey 的版本。

如果你这样做:

mvn dependency:tree -Dverbose -Dincludes=jersey-server

您将看到任何版本的 jersey-server 来自父级的图表。

我有一个 hadoop-client 和一个内部 rest-bus-client 使用我需要删除的 sun jersey(1.9.x) 版本。我在 maven 中试过,它很管用。

此外,这个球衣版本不匹配导致我在 dropwizard 中出现以下问题。