搭建自己的第一个SpringBoot程序

1、新建一个maven工程springbootfirst

 

搭建自己的第一个SpringBoot程序

2、 如果要想开发 SpringBoot 程序只需要按照官方给出的要求配置一个父 pom (spring-boot-starter-parent)和添加web开发的支持(spring-boot-starter-web)即可。

搭建自己的第一个SpringBoot程序

搭建自己的第一个SpringBoot程序

3、 编写一个具体的程序SampleController.java

搭建自己的第一个SpringBoot程序

4.启动SampleController.java,在浏览器输入http://localhost:8080/即可看到我们使用SpringBoot搭建的第一个web程序成功了,就是这么的快速、简单、方便

二、快速搭建

1、访问http://start.spring.io/

2、选择构建工具Maven Project、Spring Boot版本1.5.11以及一些工程基本信息,点击“Switch to the full version.”java版本选择1.8,可参考下图所示:

搭建自己的第一个SpringBoot程序

3、点击Generate Project下载项目压缩包

4、解压后,使用eclipse,Import -> Existing Maven Projects -> Next ->选择解压后的文件夹-> Finsh,OK done!