Android:can/should 我使用 "jackson-dataformat-xml" 进行 XML(未)编组?

Android: can/should I use "jackson-dataformat-xml" for XML (un)marshalling?

我的 Android 应用程序将使用 XML 与 SPring Boot REST 服务通信。

JAXB 不容易(或轻量级)用于 Android。所以,我阅读了有关使用 jackson-dataformat-xml 的信息。我使用(嵌套)对象列表。

我的问题:这是(取消)编组 XML 消息的首选方式吗? 如果不是,Android 的最佳选择是什么? 如果是,你能帮忙解决下面的问题吗?

JUnit 测试轻松通过。编译可以使用:

packagingOptions {
    pickFirst  'META-INF/license.txt'
    exclude 'META-INF/ASL2.0'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/MANIFEST.MF'
    exclude 'META-INF/services/com.fasterxml.jackson.core.JsonFactory'
    exclude 'META-INF/services/com.fasterxml.jackson.core.ObjectCodec'
}

dependencies { 
    .... 
    compile 'com.fasterxml.jackson.core:jackson-core:2.1.2'
    compile 'com.fasterxml.jackson.core:jackson-annotations:2.1.2'
    compile 'com.fasterxml.jackson.core:jackson-databind:2.1.2'
    compile( 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.3.0')
}

运行 App 不可用。我遇到各种错误,例如这些错误:

Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.codehaus.stax2.XMLStreamLocation2) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it is *not* an inner class.

编辑: 与此同时,我看到 Simple XML 得到了很好的评价。

我现在正在使用 Simple XML。那工作正常。