GSON Installation
To use GSON in our Java application we need to include the GSON JAR file in the classpath of our Java application.
we can do so either by adding GSON as a Maven dependency to our
project, or by downloading the JAR file and include it in the
classpath manually.
Downloading / Configuring GSON
Using Dependency's (Maven,Ivy,Grape etc..)
For Maven <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.7</version> </dependency> |
For Apache Buildr 'com.google.code.gson:gson:jar:2.7' |
For Apache Ivy <dependency org="com.google.code.gson" name="gson" rev="2.7" /> |
For Groovy Grape @Grapes( @Grab(group='com.google.code.gson', module='gson', version='2.7') ) |
Remember to insert the version of GSON you plan to use
How To Get The Updated GSON or Direct GSON Jar File
If we are not using Maven in our Java project then we can also download the GSON JAR file directly from the central Maven repositor.
- Go to Gson Maven With Pom Detail we will find the pom with dependecy details
- or for jar file
- Gson Jar Download Form Maven choose the jar for the artificatId gson