Spring boot @使用SpringBootStarter父版本1.5.9.0时,无法识别SpringBootApplication

Spring boot @使用SpringBootStarter父版本1.5.9.0时,无法识别SpringBootApplication,spring-boot,Spring Boot,从SpringSTS开始,我创建了一个全新的SpringBoot项目启动程序,添加了“WEB”特性,然后完成了项目的创建 由于某种原因,进口 import org.springframework.boot.autoconfigure.SpringBootApplication; 无法识别(我得到-“无法解析导入org.springframework.boot.autoconfigure.springboot应用程序”) 因此@SpringBootApplication注释也无法识别 packa

从SpringSTS开始,我创建了一个全新的SpringBoot项目启动程序,添加了“WEB”特性,然后完成了项目的创建

由于某种原因,进口

import org.springframework.boot.autoconfigure.SpringBootApplication;
无法识别(我得到-“无法解析导入org.springframework.boot.autoconfigure.springboot应用程序”)

因此@SpringBootApplication注释也无法识别

package com.test;

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

    @SpringBootApplication
    public class Newtest1sdfsdfApplication {

        public static void main(String[] args) {
            SpringApplication.run(Newtest1sdfsdfApplication.class, args);
        }
    }
注意:我使用的是自动创建的项目

如果我更改SpringBootStarter父级的项目版本(在pom.xml中) 从1.5.9到1.5.8,一切又恢复正常。设置回1.5.9将显示错误

含义从:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.9.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

org.springframework.boot
spring启动程序父级
1.5.9.1发布


org.springframework.boot
spring启动程序父级
1.5.8.1发布
你知道这里有什么问题吗?

我最后说:

  • .m2文件夹中删除两个子文件夹 子文件夹是:orgcom

  • 然后->从eclipse/STS:右键单击项目名称->MAVEN->更新项目

  • 尝试一下SO post的建议。我找不到提到的版本有任何问题。。。
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.8.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>