2.4. Eclipse を使用した従業員勤務表スターターアプリケーションの構築と実行
Red Hat JBoss Development Studio を含む Eclipse を使用して、従業員勤務表スターターアプリケーションを構築して実行できます。
前提条件
- Eclipse をインストールしておく必要があります。
- ホストにはインターネットアクセスが必要です (外部のリポジトリーから Maven パッケージをダウンロードするため)。
- 推奨される設定でアプリケーションを実行するには、Google Chrome をインストールする必要があります。ただし、別の Web ブラウザーを使用するように設定を変更できます。
手順
- Eclipse を起動します。
- メインメニューから File > Import… を選択します。
- Maven > Existing Maven projects ウィザードを選択します。
- root ディレクトリーでは、アプリケーションソースの root ディレクトリーを選択します。
- Finish をクリックします。
オプションで、Eclipse で多くのエラーが表示されるのを回避するには、以下を行います。
-
アプリケーションソースの root ディレクトリーで、
mvn clean installコマンドを実行して、ビルドが完了するのを待ちます。 -
Eclipse ナビゲーションツリーで、
employee-rostering-sharedを右クリックして、Build Path > Configure Build Path… を選択します。 - Source タブをクリックしてから、Add Folder… をクリックします。
-
employee-rostering-shared/target/generated-sourcesフォルダーをクリックして、OK をクリックします。
-
アプリケーションソースの root ディレクトリーで、
- メインメニューから Run > External Tools > External Tools Configurations… を選択します。
Program で以下の起動設定を作成します。
Chrome で OptaWeb 従業員勤務表を開く設定:
-
名前:
Open OptaWeb Employee Rostering in Chrome -
場所:
/usr/bin/google-chrome -
作業ディレクトリー:
${workspace_loc:/employee-rostering} 引数:
--incognito http://localhost:8080/gwtui/gwtui.html注記Chrome の代わりに別のブラウザーを使用する場合には、名前、場所、引数を変更できます。
-
名前:
コードサーバーを終了する設定:
-
名前:
Kill Code Server -
場所:
/usr/sbin/fuser -
作業ディレクトリー:
${workspace_loc:/employee-rostering} -
引数:
fuser -k 9876/tcp
-
名前:
- メインメニューから Run > Run Configurations… を選択します。
Maven Build で以下の起動設定を作成します。
OptaWeb 従業員勤務表のビルド:
-
名前:
OptaWeb Employee Rostering Build -
ベースのディレクトリー:
${workspace_loc:/employee-rostering} -
目標:
clean install -
パラメーター:
gwt:skipCompilation値:true
-
名前:
OptaWeb 従業員勤務表の起動コードサーバー:
-
名前:
OptaWeb Employee Rostering Start Code Server -
ベースのディレクトリー:
${workspace_loc:/employee-rostering} -
目標:
gwt:codeserver -
パラメーター:
gwt:skipCompilation値:true
-
名前:
OptaWeb 従業員勤務表の起動の Webserver:
-
名前:
OptaWeb Employee Rostering Start Webserver -
ベースのディレクトリー:
${workspace_loc:/employee-rostering} -
目標:
wildfly:start wildfly:deploy -
パラメーター:
gwt:skipCompilation値:true
-
名前:
OptaWeb Employee Rostering の停止の Webserver:
-
名前:
OptaWeb Employee Rostering Stop Webserver -
ベースのディレクトリー:
${workspace_loc:/employee-rostering} -
目標:
wildfly:shutdown -
パラメーター:
gwt:skipCompilation値:true
-
名前:
Launch Group の下に、
OptaWeb Employee Rostering Runという名前の起動グループを作成します。それに次のローンチを追加します。-
Program::Kill Code Server起動モード: 継承 起動後のアクション: 中断されるまで待機 -
Maven Build::OptaWeb Employee Rostering Stop Webserver起動モード: 継承 起動後のアクション: 中断されるまで待機 -
Maven Build::OptaWeb Employee Rostering Build起動モード: 継承 起動後のアクション: 中断されるまで待機 -
Maven Build::OptaWeb Employee Rostering Start Webserver起動モード: 継承 起動後のアクション: なし -
Maven Build::OptaWeb Employee Rostering Start Code server起動モード: 継承 起動後のアクション: コンソールの出力を待つ (regexp):The code server is ready at -
Program::Open OptaWeb Employee Rostering in Chrome起動モード: 継承 起動後のアクション: なし
-
アプリケーションをビルドして実行し、すぐにアクセスするには、
OptaWeb Employee Rostering Run起動グループを実行します。次にアプリケーションを変更して、起動グループに戻り、変更をテストします。注記この方法を使用してアプリケーションを起動した場合には、UI は gwt コードサーバーを使用して gwtui ソースを監視します。gwtui コードを変更すると、コードサーバーで自動的に変更を検出します。gwtui コードの変更には、アプリケーションの再構築は必要ありません。