59. 使用CLI
一旦安装好CLI,你可以输入spring来运行它。如果不使用任何参数运行spring,将会展现一个简单的帮助界面:
$ springusage: spring [--help] [--version]<command> [<args>]Available commands are:run [options] <files> [--] [args]Run a spring groovy script... more command help is shown here
你可以使用help获取任何支持命令的详细信息,例如:
$ spring help runspring run - Run a spring groovy scriptusage: spring run [options] <files> [--] [args]Option Description------ -------------autoconfigure [Boolean] Add autoconfigure compilertransformations (default: true)--classpath, -cp Additional classpath entries-e, --edit Open the file with the default systemeditor--no-guess-dependencies Do not attempt to guess dependencies--no-guess-imports Do not attempt to guess imports-q, --quiet Quiet logging-v, --verbose Verbose logging of dependencyresolution--watch Watch the specified file for changes
version命令提供一个检查你正在使用的Spring Boot版本的快速方式:
$ spring versionSpring CLI v1.4.1.RELEASE
