かんがるーさんの日記

最近自分が興味をもったものを調べた時の手順等を書いています。今は Spring Boot をいじっています。

Spring Boot 1.4.x の Web アプリを 1.5.x へバージョンアップする ( その4 )( 1.4系 → 1.5系で変更された点を修正する )

概要

記事一覧はこちらです。

Spring Boot 1.4.x の Web アプリを 1.5.x へバージョンアップする ( その3 )( Run ‘All Tests’ with Coverage 実行時に出るエラーを解消する ) の続きです。

  • 今回の手順で確認できるのは以下の内容です。
    • Release Notes を見て 1.4系 → 1.5系で変更された点を修正します。

参照したサイト・書籍

  1. Spring Boot 1.5 Release Notes
    https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-1.5-Release-Notes

  2. Spring Boot 1.5の主な変更点
    http://qiita.com/kazuki43zoo/items/c26d99bb57888e42eaf1

目次

  1. Devtools excluded by default
  2. 次回は。。。

手順

Devtools excluded by default

spring-boot-devtools がデフォルトで fat jar から除外されるようになりました。

1.4 系の時のソースに切り戻した後、build.gradle の bootRepackage の中の excludeDevtools = trueコメントアウトして jar ファイルを生成してみます。

bootRepackage {
    mainClass = 'ksbysample.webapp.lending.Application'
//    excludeDevtools = true
}

生成された ksbysample-webapp-lending-1.4.6-RELEASE.jar を解凍すると、BOOT-INF\lib の下に spring-boot-devtools-1.4.6.RELEASE.jar が入っています。

f:id:ksby:20170520150347p:plain

excludeDevtools = trueコメントアウトを元に戻すと、spring-boot-devtools-1.4.6.RELEASE.jar は入りません。

f:id:ksby:20170520151118p:plain

feature/130-issue ブランチに戻して build.gradle から excludeDevtools = true を削除して jar ファイルを生成してみます。

bootRepackage {
    mainClass = 'ksbysample.webapp.lending.Application'
}

生成された ksbysample-webapp-lending-1.5.3-RELEASE.jar を解凍すると spring-boot-devtools-1.5.3.RELEASE.jar は入っていませんでした。

f:id:ksby:20170520152522p:plain

次回は。。。

1.5 では特にソースの変更が必要なところはありませんでした。次回は Thymeleaf を 3系へバージョンアップします。

ソースコード

履歴

2017/05/20
初版発行。