在intellij中创建spring启动应用程序后立即出现错误

dddzy1tm  于 2021-07-16  发布在  Java
关注(0)|答案(1)|浏览(1897)

在intellij idea中创建spring引导应用程序后,它出现了错误。我没有编辑代码。它找不到org.spring.boot.springapplication。我已经尝试创建应用程序好几次,但没有效果。所有需要的插件都在ide中,已打开。也许有人已经有问题了
代码中的错误

package com.example.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class DemoApplication {

    public static void main(String[] args)
    {
        SpringApplication.run(DemoApplication.class, args);
    }

}

控制台中的错误

Cannot resolve org.springframework.boot:spring-boot-autoconfigure:2.4.4
Cannot resolve jakarta.annotation:jakarta.annotation-api:1.3.5
Cannot resolve org.ow2.asm:asm:5.0.4
Cannot resolve org.junit.platform:junit-platform-engine:1.7.1
Cannot resolve com.fasterxml.jackson.core:jackson-core:2.11.4
Cannot resolve jakarta.xml.bind:jakarta.xml.bind-api:2.3.3
Cannot resolve org.apache.tomcat.embed:tomcat-embed-websocket:9.0.44
Cannot resolve com.fasterxml.jackson.core:jackson-databind:2.11.4
Cannot resolve org.glassfish:jakarta.el:3.0.3
Cannot resolve org.springframework.security:spring-security-web:5.4.5
Cannot resolve org.springframework.boot:spring-boot-test:2.4.4
Cannot resolve org.springframework:spring-aspects:5.3.5
Cannot resolve org.springframework:spring-web:5.3.5
jfgube3f

jfgube3f1#

右键单击pom.xml并选择maven->reloadproject

相关问题