我删除了一个旧项目(2 岁),但在构建项目时遇到问题,出现以下错误。
Error:(57, 29) java: cannot access com.fasterxml.jackson.core.Versioned
class file for com.fasterxml.jackson.core.Versioned not found
Run Code Online (Sandbox Code Playgroud)
和
Error:(58, 29) java: cannot access com.fasterxml.jackson.core.ObjectCodec
class file for com.fasterxml.jackson.core.ObjectCodec not found
Run Code Online (Sandbox Code Playgroud)
这是我在 pom.xml 中的依赖项
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-guava</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>2.1.1</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
这是问题似乎发生的地方
@Bean
public ObjectMapper objectMapper() {
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new GuavaModule());
objectMapper.registerModule(new JodaModule());
return objectMapper;
}
Run Code Online (Sandbox Code Playgroud)
我环顾四周,尝试了不同的版本,但没有运气。我这样做错了吗?这曾经奏效过。
任何帮助,将不胜感激。
谢谢