1.工具
①eclipse + Spring Tool Suite (STS) for Eclipse插件
②spring-tool-suite-4-4.0.2.RELEASE(搜sts4官网下载)
③idea
2.new project ,选择spring -> spring starter project
spring starter project
根据自己需要的项目需求课改
可根据实际需求更改版本号和需要的依赖包,这里简单入门就只选web就好了
然后会开始自动构建项目。
可以看到,项目结构已经生成完毕
3.写一个的Controller测试
@RestController
public class TestController {
@RequestMapping("/hello")
public String test(){
return "hello,this is my fitst boot!";
}
}
4.运行spring-boot的入口文件DemoApplication.java
看到这个端口号即为启动成功