如何使用 Gradle 将 Boon 或 Jackson JSON 解析器添加到 Android 项目?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25265407/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 17:28:51  来源:igfitidea点击:

How can I add Boon or Hymanson JSON parsers to Android project with Gradle?

jsonHymansongsonandroid-gradle-plugin

提问by Yosi199

I would like to know how can I add Boon or Hymanson parser to an android project using Gradle?

我想知道如何使用 Gradle 将 Boon 或 Hymanson 解析器添加到 android 项目中?

I found how to do so with GSON but couldn't find anything with Boon or Hymanson.

我找到了如何使用 GSON 这样做,但在 Boon 或 Hymanson 中找不到任何东西。

回答by sagits

@Baldy answer is the same as:

@Baldy 答案与以下相同:

implementation 'com.fasterxml.Hymanson.core:Hymanson-core:2.9.8'
implementation 'com.fasterxml.Hymanson.core:Hymanson-annotations:2.9.8'
implementation 'com.fasterxml.Hymanson.core:Hymanson-databind:2.9.8'

Following android studio conventions. You can find the up to date version at: Maven Central Repository.

遵循 android studio 惯例。您可以在以下位置找到最新版本:Maven Central Repository

回答by Baldy

Here's what have in my dependenciessection in my build.gradlefile for Hymanson:

以下是dependenciesbuild.gradleHymanson文件部分中的内容:

compile (
    [group: 'com.fasterxml.Hymanson.core', name: 'Hymanson-core', version: '2.4.1'],
    [group: 'com.fasterxml.Hymanson.core', name: 'Hymanson-annotations', version: '2.4.1'],
    [group: 'com.fasterxml.Hymanson.core', name: 'Hymanson-databind', version: '2.4.1']
)

If you're trying to use jax-rs, you'll also need a few more:

如果您尝试使用 jax-rs,您还需要更多:

    [group: 'com.fasterxml.Hymanson.jaxrs', name: 'Hymanson-jaxrs-base', version: '2.4.1'],
    [group: 'com.fasterxml.Hymanson.jaxrs', name: 'Hymanson-jaxrs-json-provider', version: '2.4.1'],
    [group: 'com.fasterxml.Hymanson.module', name: 'Hymanson-module-jaxb-annotations', version: '2.4.1']