【发布时间】:2021-10-18 11:35:14
【问题描述】:
我尝试使用 maven-springboot 创建一个 webbservice。以下是我在 pom 文件中使用的依赖项。
<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>
<groupId>org.springframework</groupId>
<artifactId>SpringService</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>SpringService Maven Webapp</name>
<url>http://www.example.com</url>
<properties>
<springframework.version>4.3.0.RELEASE</springframework.version>
<jackson.library>2.7.5</jackson.library>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.library}</version>
</dependency>
</dependencies>
但是,我收到一个错误 Missing artifact org.springframework:spring-core:jar:4.3.0.RELEASE for spring-web, spring -core 和 spring-webmvc。请提出解决方案。
【问题讨论】:
-
<version>4${springframework.version}</version>: 你有一个错字,看到 4 了吗? -
抱歉,问这个问题时弄错了。我已经在我的问题中更正了它。
-
我试过你的配置,对我来说似乎是文件。尝试使用
-X标志在详细日志中查找线索。
标签: java spring spring-boot maven