Spring boot 官网学习笔记 - Spring Boot CLI 入门案例
- 安装CLI
- https://repo.spring.io/release/org/springframework/boot/spring-boot-cli/2.1.1.RELEASE/spring-boot-cli-2.1.1.RELEASE-bin.zip
- 解压后即可使用,免安装。解压位置 F:\tool\java\spring-boot-cli-2.1.1.RELEASE-bin\spring-2.1.1.RELEASE
- 设置环境变量 PATH+=F:\tool\java\spring-boot-cli-2.1.1.RELEASE-bin\spring-2.1.1.RELEASE\bin;
- 编制启动脚本
- F:\spring-boot-projects\test2\app.groovy
-
@RestController class ThisWillActuallyRun { @RequestMapping("/") String home(){ "Hello World!" } }
- 运行
- spring run app.groovy
- 效果