摘要: 1.开发步骤: 1. IDEA 中 新建Maven项目 2. pom.xml 添加依赖 spring-cloud-starter-eureka-server :eureka server依赖 spring-cloud-dependencies :WEB容器功能 <project xmlns="htt 阅读全文
posted @ 2018-08-01 17:09 随风落木 阅读(0) 评论(0) 推荐(0) 编辑
摘要: 每次修改 Java 后,都需要重新运行 Main 方法才能生效,这样的会降低开发效果,我们可以使用 Spring Boot 提供的开发工具来实现热部署,为项目加上以下依赖(pom.xml): <dependency> <groupId>org.springframework.boot</groupI 阅读全文
posted @ 2018-08-01 14:40 随风落木 阅读(0) 评论(0) 推荐(0) 编辑
摘要: 1.开发步骤: 1. 修改test-profiles.yml 2. 修改启动类 指定配置文件路径:spring.config.location=classpath:/test-profiles.yml @SpringBootApplication public class TestProfiles 阅读全文
posted @ 2018-08-01 14:20 随风落木 阅读(0) 评论(0) 推荐(0) 编辑
摘要: 1.开发步骤: 1. 修改my-config.properties 2. 修改启动类 指定配置文件路径:spring.config.location=classpath:/test-folder/my-config.properties public static void main(String[ 阅读全文
posted @ 2018-08-01 11:23 随风落木 阅读(0) 评论(0) 推荐(0) 编辑
摘要: Spring Boot 会按顺序读取各种配置,例如命令行参数、系统参数等,本章只讲述配置文件的参数读取。默认情况下,Spring Boot 会按顺序到以下目录读取 application.properties 或者 application.yml 文件: 1. 项目根目录的 config 目录。 2 阅读全文
posted @ 2018-08-01 11:11 随风落木 阅读(0) 评论(0) 推荐(0) 编辑
摘要: 1.开发环境: 1. JDK 1.8 2. IntelliJ IDEA 2.开发步骤: 1. 在2.1代码基础上新建 MyController.java @RestController public class MyController { @GetMapping("/hello") @Respon 阅读全文
posted @ 2018-08-01 10:39 随风落木 阅读(0) 评论(0) 推荐(0) 编辑
摘要: 1.开发环境: 1. JDK 1.8 2. IntelliJ IDEA 2.开发步骤: 1. IDEA 中 新建Maven项目 2. pom.xml 添加依赖 spring-boot-starter-web <dependencies> <dependency> <groupId>org.sprin 阅读全文
posted @ 2018-08-01 10:24 随风落木 阅读(0) 评论(0) 推荐(0) 编辑