从SPRING STS我创建了一个新鲜的Spring Boot项目启动器,我添加了“WEB”功能,然后完成了项目的创建
由于某种原因进口
import org.springframework.boot.autoconfigure.SpringBootApplication;
无法识别(我得到-“无法解析导入org. springframe.boot.autoconfigure.SpringBootApplication”)
因此@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);
}
}
注意:我正在使用自动创建的项目
如果我将spring-boot-starter-家长(在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>
到
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.8.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
知道这里有什么问题吗?
我结束了:
>
从. m2文件夹内删除两个子文件夹子文件夹是:org和com
然后-