我是Spring引导框架的新手,我添加了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)
我尝试了以下解决方案
.m2
文件夹请对以上查询提出建议。
答案 0 :(得分:0)
maven试图解决的jackson-bom版本不在maven存储库中。当我检查时,最新版本为2.10.1版本。因此,您是否可以在pom.xml中是否在显式设置杰克逊版本的任何位置进行检查? 。如果您尝试删除该文件,然后让Maven从Spring解析该版本。