java.lang.NoClassDefFoundError: jersey/repackaged/com/google/common/collect/Maps
知道我缺少什么依赖吗?我在我的pom.xml中包含了以下球衣工件,而jersey.version是2.5.1:
<dependency> <groupId>org.glassfish.jersey.containers</groupId> <artifactId>jersey-container-servlet</artifactId> <version>${jersey.version}</version> </dependency> <dependency> <groupId>org.glassfish.jersey.core</groupId> <artifactId>jersey-client</artifactId> <version>${jersey.version}</version> </dependency> <dependency> <groupId>com.sun.jersey.jersey-test-framework</groupId> <artifactId>jersey-test-framework-core</artifactId> <version>1.18</version> <scope>test</scope> </dependency> <dependency> <groupId>org.glassfish.jersey.test-framework.providers</groupId> <artifactId>jersey-test-framework-provider-grizzly2</artifactId> <version>2.6</version> <scope>test</scope> </dependency>
@R_301_323@
<dependency> <groupId>org.glassfish.jersey.bundles.repackaged</groupId> <artifactId>jersey-guava</artifactId> <version>2.6</version> </dependency>
从http://blog.dejavu.sk/2014/02/21/jersey-2-6-has-been-released-new-and-noteworthy/起
Jersey,from versions 2.6 for JAX-RS 2.0 and 1.18.1 for JAX-RS 1.1,no longer transitively brings Guava and ASM libraries to your application. This means that even when we still use them internally you can use different versions of these libraries. Classes from both of these libraries has been repackaged,
jersey.repackaged.com.google.common
andjersey.repackaged.objectweb.asm
respectively,and shrinked to lower the footprint. ASM 5 is now part of jersey-server core module and for Guava we’ve created a separate bundle module 07001 as this dependency is widely used in multiple Jersey modules.
你正在使用Jersey 2.6 jersey-test-framework-provider-grizzly2.