尝试在springboot 2中使用jersey并出现以下错误。
C:\ Users \ joannes.paul.m2 \ repository \ org \ glassfish \ hk2 \ hk2 \ 2.5.0-b42 \ hk2-2.5.0-b42.jar中的Class-Path清单属性引用了一个或多个不存在的文件:文件:/ C:/Users/joannes.paul/.m2/repository/org/glassfish/hk2/hk2/2.5.0-b42/hk2-utils.jar,文件:/ C:/ Users /joannes.paul/.m2/repository/org/glassfish/hk2/hk2/2.5.0-b42/javax.annotation-api.jar,文件:/ C:/Users/joannes.paul/.m2/repository/org /glassfish/hk2/hk2/2.5.0-b42/javax.inject.jar,文件:/ C:/Users/joannes.paul/.m2/repository/org/glassfish/hk2/hk2/2.5.0-b42/ hk2-api.jar,文件:/ C:/用户/joannes.paul/.m2/repository/org/glassfish/hk2/hk2/2.5.0-b42/aopalliance-repackaged.jar,文件:/ C:/用户/joannes.paul/.m2/repository/org/glassfish/hk2/hk2/2.5.0-b42/config-types.jar,文件:/ C:/Users/joannes.paul/.m2/repository/org/glassfish /hk2/hk2/2.5.0-b42/hk2-core.jar,文件:/ C:/Users/joannes.paul/.m2/repository/org/glassfish/hk2/hk2/2.5.0-b42/hk2- config.jar,文件:/ C:/Users/joannes.paul/.m2/repository/org/glassfish/hk2/hk2/2.5.0-b42/tiger-types .jar,文件:/ C:/Users/joannes.paul/.m2/repository/org/glassfish/hk2/hk2/2.5.0-b42/hibernate-validator.jar,文件:/ C:/ Users / joannes。 paul / .m2 / repository / org / glassfish / hk2 / hk2 / 2.5.0-b42 / validation-api.jar,文件:/ C:/Users/joannes.paul/.m2/repository/org/glassfish/hk2/ hk2 / 2.5.0-b42 / jboss-logging.jar,文件:/ C:/Users/joannes.paul/.m2/repository/org/glassfish/hk2/hk2/2.5.0-b42/classmate.jar,文件:/ C:/Users/joannes.paul/.m2/repository/org/glassfish/hk2/hk2/2.5.0-b42/hk2-locator.jar,文件:/ C:/Users/joannes.paul/.m2 /repository/org/glassfish/hk2/hk2/2.5.0-b42/javax.inject.jar,文件:/ C:/Users/joannes.paul/.m2/repository/org/glassfish/hk2/hk2/2.5。 0-b42 / javassist.jar,文件:/ C:/Users/joannes.paul/.m2/repository/org/glassfish/hk2/hk2/2.5.0-b42/hk2-runlevel.jar,文件:/ C: /Users/joannes.paul/.m2/repository/org/glassfish/hk2/hk2/2.5.0-b42/class-model.jar,文件:/ C:/Users/joannes.paul/.m2/repository/org /glassfish/hk2/hk2/2.5.0-b42/asm-all-repackaged.jar
pom.xml中的依赖项
<!-- https://mvnrepository.com/artifact/org.glassfish.hk2/hk2-utils -->
<dependency>
<groupId>org.glassfish.hk2</groupId>
<artifactId>hk2-utils</artifactId>
<version>2.5.0-b63</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-jersey -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jersey</artifactId>
<version>2.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>2.26</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.bundles.repackaged</groupId>
<artifactId>jersey-guava</artifactId>
<version>2.25.1</version>
</dependency>