java 哪些 Jackson maven 依赖项包含在用于 JAXB JSON 编组的 spring 3.1 项目中?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11629023/
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-10-31 05:51:06  来源:igfitidea点击:

Which Hymanson maven dependencies to include in spring 3.1 project for JAXB JSON marshalling?

javajsonspringjaxbmarshalling

提问by Jér?me Verstrynge

In the code sample available here, one imports the following for JSON JAXB marshalling:

此处提供的代码示例中,为 JSON JAXB 编组导入了以下内容:

<dependency>
    <groupId>org.codehaus.Hymanson</groupId>
    <artifactId>Hymanson-mapper-asl</artifactId>
    <version>1.5.3</version>
</dependency>

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-oxm</artifactId>
    <version>3.1.0.RELEASE</version>
</dependency>

Yet, thisblog post, referring to thisblog post, suggests:

然而,这篇博客文章,引用了这篇博客文章,建议:

<!-- Hymanson -->
<dependency>
    <groupId>org.codehaus.Hymanson</groupId>
    <artifactId>Hymanson-core-lgpl</artifactId>
    <version>1.3.0</version>
</dependency>
<dependency>
    <groupId>org.codehaus.Hymanson</groupId>
    <artifactId>Hymanson-mapper-lgpl</artifactId>
    <version>1.3.0</version>
</dependency>
<dependency>
    <groupId>org.codehaus.Hymanson</groupId>
    <artifactId>Hymanson-xc</artifactId>
    <version>1.3.0</version>
</dependency>

where 'Hymanson-xc provides the additional Jaxb support'.

其中“Hymanson-xc 提供了额外的 Jaxb 支持”。

What is the difference between both set of maven dependencies when it comes to JAXB JSON marhsalling in Spring? Which one should be used preferably?

就 Spring 中的 JAXB JSON 编组而言,这两组 Maven 依赖项之间有什么区别?应该优先使用哪一种?

回答by Tomer

The main difference i can see is the license.

我能看到的主要区别是许可证。

The first option uses Hymanson-mapper-aslwhich uses the apache license, while the second one uses the lgpl license. so it is really a matter of legal.

第一个选项使用Hymanson-mapper-aslapache 许可证,而第二个选项使用 lgpl 许可证。所以这真的是一个法律问题。

see here.

看到这里

回答by Lakshmi Deepak

Use this dependency in your pom.xml file.

在 pom.xml 文件中使用此依赖项。

    <dependency>
        <groupId>org.codehaus.Hymanson</groupId>
        <artifactId>Hymanson-mapper-asl</artifactId>
        <version>1.7.1</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.Hymanson.core</groupId>
        <artifactId>Hymanson-databind</artifactId>
        <version>2.5.0</version>
    </dependency>