且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

由于 java.lang.NoClassDefFoundError 无法运行代码:com/fasterxml/jackson/annotation/JsonMerge

更新时间:2021-09-11 22:25:12

您很可能通过不同的依赖项作为子依赖项导入了不同的版本.

You most likely have different versions imported through different dependencies as sub-dependencies.

您可以让 maven 向您展示所谓的有效 pom",它将为您提供完整的依赖树,然后您可以从中查看包含的内容.

You can get maven to show you the so-called "effective pom" which will give you the full dependency tree, from which you can then see where what's included.

某些 IDE(如 IntelliJ)可以选择以图形方式显示这一点,这使得查找此类冲突变得更加容易.

Some IDEs (like IntelliJ) have an option to show this graphically, which makes finding conflicts like this a lot easier.

排除较低版本,并在需要时明确向较新版本添加依赖项.

Exclude lower versions, and if required explicitly add dependencies to newer versions.