Spring boot 官网学习笔记 - Spring Boot CLI 入门案例

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

猜你喜欢

转载自www.cnblogs.com/jiangtao1218/p/10093579.html
今日推荐