我正在使用 spring boot 1.5.12.RELEASE。它工作正常,我能够构建项目。
但是现在想升级spring boot版本到1.5.15.RELEASE。我遇到了错误。
Plugin org.springframework.boot:spring-boot-maven-plugin:1.5.15.RELEASE or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.springframework.boot:spring-boot-maven-plugin:jar:1.5.15.RELEASE: Failure to transfer com.fasterxml.jackson:jackson-bom:pom:2.8.11.20180608
我有自己的存储库,所以无法从 Maven 存储库下载文件。我有 jackson 2.8.11.20180217 的版本。我没有 2.8.11.20180608 版本。
那么有什么方法可以使用版本 2.8.11.20180217 而不是 2.8.11.20180608 或者不使用 jackson。
最佳答案
为你想要的 jackson 版本添加 maven 依赖,并为所有需要 id 的模块排除 jackson 依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</exclusion>
</exclusions>
</dependency>
关于java - 如何从 spring boot pom 中排除或替换 jackson,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52093444/