spring-boot:runにパラメータを渡す
-Dオプションで spring-boot:run にパラメータが渡せず結構ハマってしまった
結論からいって、spring-boot.run.jvmArguments を使ってパラメータを設定してあげればよい。
code: bash
./mvnw spring-boot:run -Drun.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8787 -Dserver.port=9090 -Dpath.to.config.dir=/var/data/my/config/dir"
JVM arguments that should be associated with the forked process used to run the application. On command line, make sure to wrap multiple values between quotes. NOTE: a forked process is required to use this feature.
とのことで、(確か)version 2.2.0以降 Spring Boot Maven Pluginで起動すると、プロセスをforkして起動する。
その時に、springサーバ側に渡すパラメータはspring-boot.run.jvmArguments でくるんでねということの模様。
くるまなくて良いパラメータ (spring-boot.run.jvmArguments の処理自体に渡すためのパラメータ)は、以下の列挙されている