Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring-Boot Cannot Add Google Guava Dependency

I want to add Guava collections into my application but I couldn't be successful. Here is my pom definition:

    <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>

I want to use MultiMap but it cannot see Guava dependencies. On the other hand my IDE suggests me org.jvnet.hk2.component inside Glassfish. However I don't use Glassfish.

How can I add Guava dependency and remove that Glassfish dependency?

like image 506
kamaci Avatar asked Oct 21 '25 13:10

kamaci


1 Answers

You need to add spring-context-support as well.

<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>
like image 109
user1717331 Avatar answered Oct 23 '25 04:10

user1717331



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!