如何从 Spring Boot pom 中排除或替换 jackson

Pir*_*ate 1 java spring pom.xml maven spring-boot

我正在使用 Spring Boot 1.5.12.RELEASE。它工作正常,我能够构建该项目。

但是现在想把spring boot版本升级到1.5.15.RELEASE。我得到了低于错误。

插件 org.springframework.boot:spring-boot-maven-plugin:1.5.15.RELEASE 或其依赖项之一无法解析:无法读取 org.springframework.boot:spring-boot-maven-plugin 的工件描述符: jar:1.5.15.RELEASE: 无法传输 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。

Ore*_*ron 5

为您想要的 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>
Run Code Online (Sandbox Code Playgroud)