0
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 5 years have passed since last update.

Spring Initializrで作ったWebアプリケーションをJARファイルからやっぱりWARファイルに変えたい

Last updated at Posted at 2020-01-10

最近DockerでWebアプリを動かすことが増えてjarに固めることが多くなってきた気がする
つい最近まで仕事でSpring Bootを使うときはTomcatに載せてたからwarに固める必要があった(んだと思う)
まぁjarでいっかーと思ってたけどやっぱりwarにしたい!っていう時のためにメモ

前提

Spring Boot 2.2.2.RELEASE - 2.2.4.RELEASE
Kotlin 1.3.61
Gradle

環境は以下の記事のまんま

変更箇所

/build.gradle.ktsの以下を編集

plugins {
	// 追加
	war
}
dependencies {
	// 追加
	providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
}

備考

pluginswarを追加しておかないとdependenciesprovidedRuntimeを入れた時にエラーになる

課題

providedRuntimeは普段使えないのか・・・?

gradleのバージョン変えちゃったか?
providedRuntimeがエラーになる・・・
後、GradleのbuildタスクにもbootWarってのが増えてるような・・・前からあったっけ?
buildのタスク見てもwar自体はスキップされてて、bootWarが呼ばれてるような・・・あれー?

0
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
0
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?