java - 为什么 jersey-bundle 1.17.1 中的 asm 提供了作用域?

标签 java maven jersey java-bytecode-asm

我使用 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/

相关文章:

java - 如何使用 Java 查找机器上是否正确安装了某种字体

java - Web3j v3.3.1 : Error while generating compiled solidity smart contracts which returns array of struct

java - 有没有办法在 Eclipse Project Explorer 的 Maven 依赖项中获取版本信息而不是 "(without test code)"?

java - 无法在 netbeans 7.3.1 中使用 Jersey 特定功能

java - tomcat SSL请求参数丢失

java - 使用 Aether 获取 MavenProject 的所有依赖项(包括传递性依赖项)

unit-testing - 如何在 Jersey 单元测试框架 2.5 中设置 Servlet 上下文

java - Jersey 2.* 和 HK2.根据路径参数注入(inject)不同的对象(例如DAO)

java - Jersey 响应日志记录过滤器,不包括 GET 的响应主体

java - 如何从任务管理器中隐藏进程?