Import GsonFactory in maven

I kept thinking about why I can’t use Gson, in particular gsonFactory, from any library that I use.

I am using eclipse, my project has maven and I am running OS X

I look at this Authentication with backend server guide , and whenever I try to create jsonFactory = new GsonFactory();, GsonFactory cannot be resolved.

Now I have added several libraries as maven dependencies, but to no avail,

<dependency>
    <groupId>com.google.api-client</groupId>
    <artifactId>google-api-client</artifactId>
    <version>1.20.0</version>
</dependency>

<dependency>
  <groupId>com.google.http-client</groupId>
  <artifactId>google-http-client</artifactId>
  <version>1.19.0</version>
</dependency>

and also loaded several cans, but none of them allowed GsonFactory.

+4
source share
1 answer

GSON Google HTTP. . - 1.21.0, :

<dependency>
    <groupId>com.google.http-client</groupId>
    <artifactId>google-http-client-gson</artifactId>
    <version>1.21.0</version>
</dependency>
+9

Source: https://habr.com/ru/post/1629470/


All Articles