gson Getting started with gson Installation


Example

In order to use Gson you have to include it in your project. You can do this by adding the following dependency of the Gson version available in Maven Central:

Maven

Add to pom.xml

<dependencies>
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>2.8.0</version>
      <scope>compile</scope>
    </dependency>
</dependencies>

Gradle:

Add to build.gradle

compile 'com.google.code.gson:gson:2.8.0'