无法从jackson-databind maven eclipse中找到ObjectMapper

时间:2016-11-28 05:02:27

标签: java maven jackson

在pom.xml中我有:

<dependencyManagement>
   <dependencies>
      <dependency>
         <groupId>com.fasterxml.jackson.core</groupId>
         <artifactId>jackson-core</artifactId>
         <version>2.8.4</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.8.4</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>2.8.4</version>
      </dependency>
   </dependencies>
</dependencyManagement>

<dependencies>
   <dependency>
         <groupId>com.fasterxml.jackson.core</groupId>
         <artifactId>jackson-core</artifactId>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
      </dependency>
</dependencies>

在右键单击项目时 - &gt;运行方式 - &gt; Maven安装,我收到以下错误:

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile 
(default-compile) 
on project GPS: Fatal error compiling java.lang.NoClassDefFoundError:     
com/fasterxml/jackson/databind/ObjectMapper:   
com.fasterxml.jackson.databind.ObjectMapper -> [Help 1]

其他解决方案说jackson-databind.jar缺失了,但我已经在我的依赖项和.classpath中得到了它。

0 个答案:

没有答案