Search code examples
javamavenjerseyjava-bytecode-asm

Why asm in jersey-bundle 1.17.1 is scope provided?


I'm using the jersey-bundle dependency (v1.17.1) and get a ClassNotFoundException: org.objectweb.asm.ClassVisitor.

This happens because asm's depepndency in jersey-bundle is defined as provided, thus not retrieving the asm jar when packaging my app.

Why is asm defined as provided in the jersey-bundle pom?

<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>3.1</version>
<scope>provided</scope>
</dependency>

Solution

  • The description of this bundle says :

    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.

    In others words : it's buggy as a maven dependencies ;-)

    There is an issue about it - JERSEY-599 (closed - but not really solved).