59. 使用CLI

一旦安装好CLI,你可以输入spring来运行它。如果不使用任何参数运行spring,将会展现一个简单的帮助界面:

  1. $ spring
  2. usage: spring [--help] [--version]
  3. <command> [<args>]
  4. Available commands are:
  5. run [options] <files> [--] [args]
  6. Run a spring groovy script
  7. ... more command help is shown here

你可以使用help获取任何支持命令的详细信息,例如:

  1. $ spring help run
  2. spring run - Run a spring groovy script
  3. usage: spring run [options] <files> [--] [args]
  4. Option Description
  5. ------ -----------
  6. --autoconfigure [Boolean] Add autoconfigure compiler
  7. transformations (default: true)
  8. --classpath, -cp Additional classpath entries
  9. -e, --edit Open the file with the default system
  10. editor
  11. --no-guess-dependencies Do not attempt to guess dependencies
  12. --no-guess-imports Do not attempt to guess imports
  13. -q, --quiet Quiet logging
  14. -v, --verbose Verbose logging of dependency
  15. resolution
  16. --watch Watch the specified file for changes

version命令提供一个检查你正在使用的Spring Boot版本的快速方式:

  1. $ spring version
  2. Spring CLI v1.4.1.RELEASE