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?

SpringBoot デプロイ jar VS war

Posted at

jar

  • クラスファイルやリソースファイルやメタデータをまとめた圧縮ファイル
  • 内部に TomcatなどServletコンテナを含む
    • fat jar という
  • 1ファイルで完結、シンプル
  • モダンな開発向き
  • CLIで直接起動できる
java -jar myapp.jar
  • 梱包されてるtomcatの設定はどうやってやるの?
    • springの設定ファイル(application.properties や application.yml)を使う
    • 高度な設定はjava側で行う
      • TomcatServletWebServerFactory@Bean で定義

war

  • 外部アプリサーバー(Tomcatなど)で動かすための形式
  • WAR+サーバーの構成が必要
  • どっちかというと昔ながら。伝統的なやり方(失礼)
  • CLIのコマンドではなく、tomcatなどに乗せる前提

どっちにしろ大量の.classファイルなんかをzipみたいに圧縮してるだけ
意外とシンプル

jarがモダンでよく使われる

  • DockerやCI/CD連携を考えると持ち運びしやすい
  • マイクロサービス的な流れ

参考文献

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?