LoginSignup
0
2

More than 5 years have passed since last update.

Spring-bootでwarファイルをTomcatにデプロイする

Posted at

環境

  • java8

  • sts 3.7.1

  • spring-boot 1.5.1

その他前提

  1. starter-sequrity
  2. tyymeleaf
  3. starter-web
  4. starter-tomcat をプロジェクトに組み込んでいる

デプロイ先は、AmazonLinuxのEC2、Tomcat等設定済み

                <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
                <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>

手順

プロジェクトを右クリックし、Exportを選択する
スクリーンショット 2017-03-11 17.07.38.png

Web > Warファイルを選択する
スクリーンショット 2017-03-11 17.07.47.png

  • Web Projectに出力するプロジェクトを設定し

  • Distinationに出力先ディレクトリとファイル名を指定する

  • 同じファイルが存在している場合は、Ovewrite existing file

このとき出力できないことがある

  • warファイルがExportできない時 参照

スクリーンショット 2017-03-11 17.08.04.png

  • Tomcatの管理画面へ入る
http://ホスト名:8080/manager

スクリーンショット 2017-03-11 17.08.30.png

  • warファイルを配備で、出力したwarファイルを選択し、配備を行う。

  • 配備が完了すると、上記のリストに追加され、停止起動閲覧等が可能になる
    スクリーンショット 2017-03-11 17.08.37.png


 warファイルがExportできない時

スクリーンショット 2017-03-11 17.10.55.png

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