Gson Maven Dependency

Gson is a Java library that can be used to convert Java Objects into their JSON representation. It can also be used to convert a JSON string to an equivalent Java object.

Check out the Gson tutorial at https://www.javaguides.net/p/google-gson-tutorial.html.

This page gives you a quick reference to get Gson dependency for Maven or Gradle projects. You can also download the Gson jar dependency, the link given at the "Download JAR File" section.

Gson Maven Dependency

Copy below Gson maven dependency and paste in your project pom.xml file:
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
    <groupId>com.google.code.gson</groupId>
    <artifactId>gson</artifactId>
    <version>2.8.6</version>
</dependency>
For more details about the proper version to use, check out the following Maven Central link.

Gson Gradle Dependency

Copy below Gson gradle dependency and paste in your project build.gradle file:
// https://mvnrepository.com/artifact/com.google.code.gson/gson
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.6'

Download JAR File

Check for Latest Release

Reference




Comments