0

I am trying to include gson in javaEE project with Maven:

<dependencies>
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.8.5</version>
    </dependency>
</dependencies>

This is my output:

enter image description here

Project settings:

enter image description here

Yet it complains :

java.lang.NoClassDefFoundError: com/google/gson/Gson

I am using intelliJ. What is the right way to include it? So far i have only found the output is in correct format...

Thanks for help!

Darlyn
  • 4,715
  • 12
  • 40
  • 90

1 Answers1

0

Can you paste all the pom.xml please, it seems like the javax.servlet reference is missing in tthe pom.

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.0.1</version>
    <scope>provided</scope>
</dependency>