1.下载地址
https://repo.spring.io/release/org/springframework/boot/spring-boot-cli/
2.配置环境变量
Path=D:\spring-2.1.13.RELEASE\bin
3.验证
spring --version
4.新建groovy文件
@RestController
class WebAppliction {
@RequestMapping("/")
String home(){
return "Hello world!";
}
}
5. 运行程序
spring run hello.groovy ----server-port:9000
6.打包程序
spring jar hello.jar *.groovy --include resource/**,static/**,templates/** --exclude target/**,build/**
7.构建spring boot项目
spring init --denpendencies=web,data-redis knowledge-financial
spring init --list
本文详细介绍如何从零开始使用SpringBoot创建并运行一个简单的Web应用程序。包括下载SpringBoot CLI、配置环境变量、编写Groovy源代码、运行及打包程序等步骤。通过本文,读者可以快速掌握SpringBoot的基本操作。

1112

被折叠的 条评论
为什么被折叠?



