spring cli的安装和使用

下载:

https://repo.spring.io/ui/native/release/org/springframework/boot/spring-boot-cli/2.4.5/

把下载的压缩包解压到D:\soft\spring-boot-cli-2.4.5-bin\spring-2.4.5,在path环境变量里追加D:\soft\spring-boot-cli-2.4.5-bin\spring-2.4.5\bin即可

打开新的cmd命令行提示符,使用spring --version可以看到输出的版本信息,代表spring cli配置成功

 

新建hello.groovy,代码如下:

@RestController
class ThisWillActuallyRun {
    @RequestMapping("/")
    String home() {
        "Hello World!--------"
    }
}

 

spring run hello.groovy 等待项目启动

 

访问:

http://localhost:8080/

 

参考资料:

 https://www.jb51.net/article/226867.htm

posted @ 2022-05-19 14:40  jamstack  阅读(178)  评论(0编辑  收藏  举报