IntelliJ IDEA - TomcatでWebアプリケーションを実行/デバッグする

IntelliJ IDEA – TomcatでWebアプリケーションを実行/デバッグします

この記事では、IntelliJ IDEAを使用して、TomcatサーバーでWebアプリケーションを実行またはデバッグする方法を示します。

Note
Eclipse IDEとは異なり、追加サーバーを構成するための「サーバービュー」が常にあります。IntelliJは別の方法で処理します。最初に「アーティファクト(warファイル)」を追加してから、下部に「サーバービュー」が表示されます。

1. Tomcatプラグイン

1.1 File –>> Settings –>> Type Plugin –>> Make sure Tomcat and TomEE Integration is checked.

idea-run-debug-tomcat-example

2. Run/Debug Configuration

2.1 Run –>> Edit Configurations…

idea-run-debug-tomcat-example1

2.2 Clicks + icon, select Tomcat Server –>> Local

idea-run-debug-tomcat-example2

3. Tomcatの構成

3.1 Clicks on the “Deployment” tab, + icon to select an artifact to deploy. ブレークポイントのデバッグでは、常に展開された戦争バージョンを選択します。

idea-run-debug-tomcat-example4

3.2 Clicks on “Server” tab, select a Tomcat server, and update the on 'Update' action to “Update classes and resources” – for hot swap.

idea-run-debug-tomcat-example5

4. アプリケーションサーバー

4.1 Now you can see an “Application Servers” view displayed at the bottom panel.

idea-run-debug-tomcat-example6

Webアプリケーションを開始またはデバッグします。