我使用 jersey-bundle 依赖项 (v1.17.1) 并获得 ClassNotFoundException: org.objectweb.asm.ClassVisitor
。
发生这种情况是因为 jersey-bundle 中的 asm 依赖关系已定义为提供的,因此在打包我的应用程序时不会检索 asm jar。
为什么 asm 的定义如 jersey-bundle pom 中提供的那样?
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>3.1</version>
<scope>provided</scope>
</dependency>
最佳答案
该 bundle 的描述如下:
A bundle containing code of all jar-based modules that provide JAX-RS and Jersey-related features. Such a bundle is only intended for developers that do not use Maven's dependency system. The bundle does not include code for contributes, tests and samples.
换句话说:作为 Maven 依赖项,它是有问题的;-)
有一个关于它的问题 - JERSEY-599 (已关闭 - 但尚未真正解决)。
关于java - 为什么 jersey-bundle 1.17.1 中的 asm 提供了作用域?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35536348/