java - 找不到依赖项 'org.springframework.boot:spring-boot-starter-web:2.3.0.RELEASE'

标签 java spring-boot maven

我在创建简单的 spring boot Web 应用程序时遇到问题。我正在使用 Intellij Idea IDE 构建这个应用程序。出现了与依赖性相关的问题。 Intellij 说 - 找不到依赖项 'org.springframework.boot:spring-boot-starter-web:2.3.0.RELEASE'(在 pom.xml 中)。

详细错误信息:

Dependency 'org.springframework.boot:spring-boot-starter-web:2.3.0.RELEASE' not found.
Tag name: artifactId Description : The unique id for an artifact produced by the project group, e.g. maven-artifact. Version : 3.0.0+ 
<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.0.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>springboot-demo</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>springboot-demo</name>
    <description>Demo project for Spring Boot</description>

    <properties>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

最佳答案

我也有类似的问题。最简单的修复方法是使缓存无效并重新启动

IntelliJ Idea Invalidate Caches and Restart

Maven 将在重启后重新同步您的 POM 文件。无需在其他任何地方进行更改。

Spring Boot 2.3.0.RELEASE

关于java - 找不到依赖项 'org.springframework.boot:spring-boot-starter-web:2.3.0.RELEASE',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61909247/

相关文章:

java - 如何在 Eclipse Luna 中获取旧颜色主题?

java - Spring Batch 读取器、处理器和写入器流程

java - 如何使用 Spring Data JPA ORM 在运行时动态切换数据库

java - 如何在 SVN 中自动 checkin 由 maven build 生成的文件?

java - 在 Tomcat 服务器上自动启动 Spring Boot 应用程序

java - 如何打印到同一行?

java - 部署在 Heroku 上的 Spring Boot 应用程序仍然崩溃

java - Spring boot - MySQL 设置不起作用

java - *.war 文件无法在 Tomcat 上创建任何内容的主要原因是什么?

java - 即使我有正确的 jar,也会出现 ClassNotFoundException