java 无法解析导入的 com.fasterxml.jackson.xml

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

The import com.fasterxml.Hymanson.xml cannot be resolved

javaspringmavenspring-mvcHymanson

提问by Sp1

I am facing the error The import com.fasterxml.Hymanson.xml cannot be resolved. XmlMapper cannot be resolved to a type
in the import com.fasterxml.Hymanson.xml.XmlMapper;.

我对着错误The import com.fasterxml.Hymanson.xml cannot be resolved. XmlMapper cannot be resolved to a type
import com.fasterxml.Hymanson.xml.XmlMapper;

My pom :

我的 pom :

<modelVersion>4.0.0</modelVersion>
         <dependency>
            <groupId>com.fasterxml.Hymanson.core</groupId>
            <artifactId>Hymanson-annotations</artifactId>
            <version>${Hymanson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.Hymanson.core</groupId>
            <artifactId>Hymanson-core</artifactId>
            <version>${Hymanson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.Hymanson.core</groupId>
            <artifactId>Hymanson-databind</artifactId>
            <version>${Hymanson.version}</version>
        </dependency>

Is there a problem in the version? Other import of Hymanson core and databind seems to work completely fine. This happens in the case of xml only.

是不是版本有问题?Hymanson core 和 databind 的其他导入似乎完全正常。这只发生在 xml 的情况下。

采纳答案by dimitrisli

This is an old jar with different Maven coordinates.

这是一个具有不同 Maven 坐标的旧 jar。

Try:

尝试:

<dependency>
    <groupId>com.fasterxml</groupId>
    <artifactId>Hymanson-xml-databind</artifactId>
    <version>0.6.2</version>
</dependency>

回答by kuhajeyan

try adding

尝试添加

<dependency>
    <groupId>com.fasterxml</groupId>
    <artifactId>Hymanson-xml-databind</artifactId>
    <version>0.6.2</version>
</dependency>

or

或者

<dependency>
    <groupId>com.fasterxml.Hymanson.dataformat</groupId>
    <artifactId>Hymanson-dataformat-xml</artifactId>
    <version>2.8.5</version>
</dependency>

回答by kleash

Add

添加

<dependency>
  <groupId>com.fasterxml.Hymanson.dataformat</groupId>
  <artifactId>Hymanson-dataformat-xml</artifactId>
  <version>${Hymanson.version}</version>
</dependency>

and import com.fasterxml.Hymanson.dataformat.xml.XmlMapper;

import com.fasterxml.Hymanson.dataformat.xml.XmlMapper;

For more reference, visit: https://github.com/FasterXML/Hymanson-dataformat-xml

更多参考,请访问:https: //github.com/FasterXML/Hymanson-dataformat-xml