打开Spring的官网,在很显眼的位置上你就可以看到下图。
似乎有一些狂妄。
一直以来,由于自己的自身认知水平问题,我对这个宣传是持有否定意见的。但是当我看到了Spring Boot Cli之后
好吧,真香~
Spring Boot Cli官网传送
先来看一下官方是如何定义SpringBootCli的:
Spring Cloud CLI is a set of extensions for the Spring Boot CLI making it possible to run Spring Cloud server apps and write Spring Cloud apps in Groovy scripts and run them from a shell. Auto-imports and dependency management is provided for all Spring Cloud projects.
大概翻译一下:
Spring Cloud CLI是Spring Boot CLI的一组扩展,可以运行Spring Cloud服务器应用程序并在Groovy脚本中编写Spring Cloud应用程序并从shell运行它们。为所有Spring Cloud项目提供自动导入和依赖关系管理。
废话少说,进入安装步骤:
For Windows
打开浏览器,从http://repo.spring.io/release/org/springframework/boot/spring-boot-cli/ 可以下载不同的版本,Windows的话选择以.zip结尾,下载之后进行解压。
本人以spring-boot-cli-1.5.9.RELEASE为例进行说明。
编辑CLI环境变量信息
将信息写入Path中
验证环境变量是否生效
如上所示,代表环境已经安装完毕。下面编写HelloWorld
执行 spring run Hello.java
访问http://localhost:8080/hello
新手,欢迎拍砖~更多文章可搜索:彪悍大蓝猫