springboot快速搭建
一、IDEA新建项目
下一步
下一步
创建完成
- SpringbootApplication: 一个带有 main() 方法的类,用于启动应用程序
- SpringbootApplicationTests:一个空的 Junit 测试了,它加载了一个使用 Spring Boot 字典配置功能的 Spring 应用程序上下文
- application.properties:一个空的 properties 文件,可以根据需要添加配置属性
二、配置文件配置key=value
三、创建controller层
在代码里@value注解可以取到对用得key键得value值
四、用SpringbootApplication得main方法启动项目
五、用项目controllerder得url浏览器查看
六、springboot支持热部署,不需要重新启动也能看到修改后的效果
在 pom.xml 中添加一个依赖就可以了:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 这个需要为 true 热部署才有效 -->
</dependency>