はじめに
Spring Boot CLI を使ってGroovyアプリを動かしてみようと思ったら
”Ruby Gem”の”Spring”に邪魔され、
Spring Boot CLIのコマンド”spring run”ができなかったので
解決策をメモしておきます。
解決策
1. Spring Boot CLI用のパスを通す
.zshrc に以下の2行を追加
(お使いの環境にあわせて.zshrcは.bashrcなりに変換してください)
export SPRING_HOME=/Users/Y_h/spring-1.5.6.RELEASE
export PATH=$SPRING_HOME/bin/:$PATH
からの
source ~/.zshrc
で変更を反映
2. Spring Boot CLIの動作確認
$ spring
とTerminalに入力し…
usage: spring [--help] [--version]
<command> [<args>]
Available commands are:
run [options] <files> [--] [args]
Run a spring groovy script
test [options] <files> [--] [args]
Run a spring groovy script test
grab
Download a spring groovy script's dependencies to ./repository
jar [options] <jar-name> <files>
Create a self-contained executable jar file from a Spring Groovy script
war [options] <war-name> <files>
Create a self-contained executable war file from a Spring Groovy script
install [options] <coordinates>
Install dependencies to the lib/ext directory
uninstall [options] <coordinates>
Uninstall dependencies from the lib/ext directory
init [options] [location]
Initialize a new project using Spring Initializr (start.spring.io)
shell
Start a nested shell
Common options:
-d, --debug Verbose mode
Print additional status information for the command you are running
See 'spring help <command>' for more information on a specific command.
と表示されればOK
おつかれさま自分
最後に
インストールガイドをよく見れば書いてあることなんですが
はまってしまいました…