weblog

技術的なメモ置き場。

Spring Boot DevToolsで自動リロード

IntelliJ IDEA + Spring Boot DevToolsで自動リロードさせることができる。

Preferences > Build, Execution, Deployment > Compiler を開き、 Build project automatically を有効にする。

f:id:kentama7:20190602170513p:plain

⌘ + Shift + a で Registry... を選択する。

f:id:kentama7:20190602170830p:plain

compiler.automake.allow.when.app.running を有効にする。

f:id:kentama7:20190602171219p:plain

Spring Initializrで生成したbuild.gradle.ktsのdevelopmentOnlyのエラー回避

Spring Initializrで Gradle + Kotlinを選択すると、build.gradle.ktsでdevelopmentOnlyでエラーが発生する。
以下に変更するととりあえず動く。

val developmentOnly: Configuration by configurations.creating

configurations {
    developmentOnly
    runtimeClasspath {
        extendsFrom(configurations["developmentOnly"])
    }
}

IntelliJ 最終行に空白行を自動で挿入させる

IntelliJ IDEAで最終行に空白行を自動で挿入させるには、 Preferences > Editor > General を開き、 Otherの Ensure line feed at file end on Save を有効にする。