1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

eclipse spring devtools ホットデプロイ試した

Last updated at Posted at 2021-06-26

springのdevtoolsの自動再起動機能を試した。
気づいたのはdevtoolsのrestartの設定はデフォルト:trueだったこと。

リロード速度

  • クラスの変更は再起動に3秒ぐらい(クラスの数に影響しそう)
  • Thymeleafの変更は再起動なしですぐ反映される

dependenciesにdevtools設定

build.gradle
dependencies {
	implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
	implementation 'org.springframework.boot:spring-boot-starter-web'
	providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
	testImplementation 'org.springframework.boot:spring-boot-starter-test'
	developmentOnly 'org.springframework.boot:spring-boot-devtools' // ここ追記した
}

application.ymlにrestart設定

restart設定のデフォルトは true
あえてfalseにしないなら設定不要。

application.yml
spring:
  devtools:
    restart:
      enabled: true

リロード確認

確認対象 devtoolsなし devtools利用 restartあえてfalse
Controllerメソッド処理変更 :no_entry_sign: :ok: :no_entry_sign:
Controller@RequestMappingのついたメソッドを追加 :no_entry_sign: :ok: :no_entry_sign:
Controllerクラス追加 :no_entry_sign: :ok: :no_entry_sign:
Thymeleaf内容編集 :no_entry_sign: :ok: :ok:
Thymeleafファイル追加 :no_entry_sign: :ok: :ok:

参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?