java SpringBoot无法添加Google Guava依赖项
我想将番石榴系列添加到我的应用程序中,但未能成功。以下是我对pom的定义:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jersey</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity4</artifactId>
<version>2.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
我想使用MultiMap
,但它看不到Guava依赖项。另一方面,我的IDE建议我在Glassfish中org.jvnet.hk2.component
。但是我不使用玻璃鱼
如何添加番石榴依赖项并删除Glassfish依赖项
# 1 楼答案
您还需要添加spring上下文支持
# 2 楼答案
看起来像是版本兼容性问题
Guava默认值随spring boot server提供,如果需要特定版本,则必须使用特定版本覆盖默认值