Springboot启动问题
通过方法1主程序类main方法启动报错:
Error:(3, 47) java: 程序包org.springframework.web.bind.annotation不存在
Error:(4, 46) java: 程序包org.springframework.boot.autoconfigure不存在
@SpringBootApplication
public class Springboothello4Application {
public static void main(String[] args) {
SpringApplication.run(Springboothello4Application.class, args);
}
}
通过方法2启动却成功:
mvn clean compile
mvn insrall
mvn spring-boot:run
这是 什么原因
你构建一下项目再直接run试试,build project