Spring 2.2.1构建错误无法找到 Artifact com.fasterxml.jackson :jackson-bom:pom:2. 10.5

标签 spring maven spring-boot maven-3

我是 Spring boot 框架的新手,我添加了 spring-boot-starter-parent 我在我的父 pom 中添加了 spring-boot-starter-parent

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.1.RELEASE</version>
        <relativePath/>     
</parent>

pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>Parent</groupId>
        <artifactId>Parent</artifactId>
        <version>7.0.0.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <artifactId>Child</artifactId>
    <packaging>pom</packaging>
    <version>7.0.0.0</version>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.compiler.version>1.8</java.compiler.version>
        <maven-jar-plugin.version>2.6</maven-jar-plugin.version>
        <maven-surefire-plugin>2.19.1</maven-surefire-plugin>
        <maven-assembly-plugin.version>2.5.5</maven-assembly-plugin.version>
        <spring.version>4.1.7.RELEASE</spring.version>
        <junit.version>4.11</junit.version>
        <maven-war-plugin.version>2.6</maven-war-plugin.version>
        <maven-eclipse-plugin.version>2.10</maven-eclipse-plugin.version>
        <tomcat.version>8.5.12</tomcat.version>
        <tomcat.8.0.version>8.0.50</tomcat.8.0.version>
        <log4j.version>1.2.16</log4j.version>
        <httpclient.version>4.5.3</httpclient.version>
        <jackson.version>2.9.5</jackson.version>
        <powermock.version>1.7.4</powermock.version>
        <junit.version>4.11</junit.version>
        <mockito.version>1.10.16</mockito.version>
        <slf4j.version>1.7.5</slf4j.version>
        <consul.version>0.14.0</consul.version>
        <json.version>20080701</json.version>
        <dom4j.version>1.6.1</dom4j.version>
        <implementation.version>7.0.0.0</implementation.version>
    </properties>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <source>${java.compiler.version}</source>
                    <target>${java.compiler.version}</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven-jar-plugin.version}</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Implementation-Version>${project.version}</Implementation-Version>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin}</version>
                <configuration>
                    <argLine>-Xmx512m -XX:MaxPermSize=256m</argLine>
                </configuration>
            </plugin>

        </plugins>

    </build>
    <modules>

    </modules>
</project>

现在在 pom.xml 中显示错误。

Project build error: Non-resolvable import POM: Could not find artifact com.fasterxml.jackson:jackson-bom:pom:2.10.5 in central (https://repo.maven.apache.org/maven2)

我尝试了以下解决方案

  • 更新我的 Maven 项目
  • 删除并重建 .m2 文件夹

请对上述查询提出建议。

最佳答案

maven 尝试解析的 jackson-bom 版本不在 maven 存储库中。当我检查最新版本时,版本是 2.10.1 。那么,您可以检查一下您的 pom.xml 中是否在任何地方显式设置了 jackson 版本吗? 。如果您尝试删除它并让 Maven 从 spring 解析版本。

关于Spring 2.2.1构建错误无法找到 Artifact com.fasterxml.jackson :jackson-bom:pom:2. 10.5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59083301/

相关文章:

Spring RequestMapping 头痛

java - Springframework - 在 null 上找不到属性或字段

java - STS 需要很长时间才能启动

maven - 如何让 maven-gpg-plugin 使用来自环境变量或命令行属性的密码?

spring-boot - Spring Boot Actuator - 多个健康端点

java - 跟踪已处理的 jms 消息

maven - 如何在 Docker 容器中的 JoNaS 上部署应用程序

java - maven-osgi 项目中的 EventAdmin 为空

oracle - 在 Spring Data Repository 中刷新 Oracle Materialized View

java - "Not a managed type..."启动 Spring Boot 应用程序时出错。我究竟做错了什么?