gpt4 book ai didi

java - Spring-Boot 无法添加 Google Guava 依赖

转载 作者:行者123 更新时间:2023-12-03 22:15:03 26 4
gpt4 key购买 nike

我想将 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 建议我 org.jvnet.hk2.component在 Glassfish 里面。但是我不使用 Glassfish。

如何添加 Guava 依赖项并删除该 Glassfish 依赖项?

最佳答案

您还需要添加 spring-context-support。

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
</dependency>

关于java - Spring-Boot 无法添加 Google Guava 依赖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39690861/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com