環境変数を使う
起動オプションで指定する方法もあるみたいだが、現状はIntelliJから起動したり、eclipseから起動したり、VSCodeから起動したりするのでこっちの方が楽な気がした。
application-xxx.ymlという名前の設定ファイルを用意する。
環境変数にSPRING_PROFILES_ACTIVEというKEYを作成し、先に作ったapplication-xxx.ymlのxxxの部分をValueに指定する。
そのまま実行。IntelliJだとIDEを再起動しないと環境変数を読み込んでくれなった。
うまくいかない場合は環境変数のリロードを試すべき。