2.4. Eclipse を使用した従業員勤務表スターターアプリケーションの構築と実行


Red Hat JBoss Development Studio を含む Eclipse を使用して、従業員勤務表スターターアプリケーションを構築して実行できます。

前提条件

  • 「デプロイメントファイルの準備」 の説明に従ってデプロイメントファイルを準備しておく。
  • Eclipse がインストールされている。
  • ホストからインターネットにアクセスできる。ビルドプロセスは、インターネットを使用して、外部のリポジトリーから Maven パッケージをダウンロードします。
  • Google Chrome がインストールされている。これは、推奨の設定でアプリケーションを実行するためです。
注記

別の Web ブラウザーを使用するように設定を変更できます。

手順

  1. Eclipse を起動します。
  2. メインメニューから File > Import…​ を選択します。
  3. Maven > Existing Maven projects ウィザードを選択します。
  4. root ディレクトリーでは、アプリケーションソースの root ディレクトリーを選択します。
  5. Finish をクリックします。
  6. オプションで、Eclipse で多くのエラーが表示されるのを回避するには、以下を行います。

    1. アプリケーションソースの root ディレクトリーで、mvn clean install コマンドを実行して、ビルドが完了するのを待ちます。
    2. Eclipse ナビゲーションツリーで、employee-rostering-shared を右クリックして、Build Path > Configure Build Path…​ を選択します。
    3. Source タブをクリックしてから、Add Folder…​ をクリックします。
    4. employee-rostering-shared/target/generated-sources フォルダーをクリックして、OK をクリックします。
  7. メインメニューから Run > External Tools > External Tools Configurations…​ を選択します。
  8. Program で以下の起動設定を作成します。

    1. Chrome で OptaWeb 従業員勤務表を開く設定:

      • 名前: Open OptaWeb Employee Rostering in Chrome
      • 場所: /usr/bin/google-chrome
      • 作業ディレクトリー: ${workspace_loc:/employee-rostering}
      • 引数: --incognito http://localhost:8080/gwtui/gwtui.html

        注記

        Chrome の代わりに別のブラウザーを使用する場合には、名前、場所、引数を変更できます。

    2. コードサーバーを終了する設定:

      • 名前: Kill Code Server
      • 場所: /usr/sbin/fuser
      • 作業ディレクトリー: ${workspace_loc:/employee-rostering}
      • 引数: fuser -k 9876/tcp
  9. メインメニューから Run > Run Configurations…​ を選択します。
  10. Maven Build で以下の起動設定を作成します。

    1. OptaWeb 従業員勤務表のビルド:

      • 名前: OptaWeb Employee Rostering Build
      • ベースのディレクトリー: ${workspace_loc:/employee-rostering}
      • 目標: clean install
      • パラメーター: gwt:skipCompilation 値: true
    2. OptaWeb 従業員勤務表の起動コードサーバー:

      • 名前: OptaWeb Employee Rostering Start Code Server
      • ベースのディレクトリー: ${workspace_loc:/employee-rostering}
      • 目標: gwt:codeserver
      • パラメーター: gwt:skipCompilation 値: true
    3. OptaWeb 従業員勤務表の起動の Webserver:

      • 名前: OptaWeb Employee Rostering Start Webserver
      • ベースのディレクトリー: ${workspace_loc:/employee-rostering}
      • 目標: wildfly:start wildfly:deploy
      • パラメーター: gwt:skipCompilation 値: true
    4. OptaWeb Employee Rostering の停止の Webserver:

      • 名前: OptaWeb Employee Rostering Stop Webserver
      • ベースのディレクトリー: ${workspace_loc:/employee-rostering}
      • 目標: wildfly:shutdown
      • パラメーター: gwt:skipCompilation 値: true
  11. 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 起動モード: 継承 起動後のアクション: なし
  12. アプリケーションをビルドして実行し、すぐにアクセスするには、OptaWeb Employee Rostering Run 起動グループを実行します。次にアプリケーションを変更して、起動グループに戻り、変更をテストします。

    注記

    この方法を使用してアプリケーションを起動した場合には、UI は gwt コードサーバーを使用して gwtui ソースを監視します。gwtui コードを変更すると、コードサーバーで自動的に変更を検出します。gwtui コードの変更には、アプリケーションの再構築は必要ありません。

Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る