34.2. Maven プラグインを使用した OptaPlanner Red Hat build of Quarkus Maven プロジェクトの作成


Apache Maven および Quarkus Maven プラグインを使用して、Red Hat build of OptaPlanner および Quarkus アプリケーションの使用を開始できます。

前提条件

  • OpenJDK 11 以降がインストールされている。Red Hat build of Open JDK は Red Hat カスマーポータル (ログインが必要) の ソフトウェアダウンロード ページから入手できます。
  • Apache Maven 3.6 以降がインストールされている。Maven は Apache Maven Project の Web サイトから入手できます。

手順

  1. コマンドターミナルで以下のコマンドを入力し、Maven が JDK 11 を使用していること、そして Maven のバージョンが 3.6 以上であることを確認します。

    mvn --version
    Copy to Clipboard Toggle word wrap
  2. 上記のコマンドで JDK 11 が返されない場合は、JDK 11 へのパスを PATH 環境変数に追加し、上記のコマンドを再度入力します。
  3. Quarkus OptaPlanner クイックスタートプロジェクトを生成するには、以下のコマンドを入力します。

    mvn com.redhat.quarkus.platform:quarkus-maven-plugin:2.13.Final-redhat-00006:create \
        -DprojectGroupId=com.example \
        -DprojectArtifactId=optaplanner-quickstart  \
        -Dextensions="resteasy,resteasy-jackson,optaplanner-quarkus,optaplanner-quarkus-jackson" \
        -DplatformGroupId=com.redhat.quarkus.platform
        -DplatformVersion=2.13.Final-redhat-00006 \
        -DnoExamples
    Copy to Clipboard Toggle word wrap

    このコマンドは、./optaplanner-quickstart ディレクトリーで以下の要素を作成します。

    • Maven の構造
    • src/main/dockerDockerfile ファイルの例
    • アプリケーションの設定ファイル

      Expand
      表34.1 mvn io.quarkus:quarkus-maven-plugin:2.13.Final-redhat-00006:create コマンドで使用したプロパティー
      プロパティー説明

      projectGroupId

      プロジェクトのグループ ID。

      projectArtifactId

      プロジェクトのアーティファクト ID。

      extensions

      このプロジェクトで使用する Quarkus 拡張のコンマ区切りリスト。Quarkus 拡張の全リストは、特定のコマンドラインで mvn quarkus:list-extensions を入力します。

      noExamples

      テストまたはクラスを使用せずに、プロジェクト構造でプロジェクトを作成します。

      projectGroupID および projectArtifactID プロパティーの値を使用して、プロジェクトバージョンを生成します。デフォルトのプロジェクトバージョンは 1.0.0-SNAPSHOT です。

  4. OptaPlanner プロジェクトを表示するには、OptaPlanner Quickstarts ディレクトリーに移動します。

    cd optaplanner-quickstart
    Copy to Clipboard Toggle word wrap
  5. pom.xml ファイルを確認します。コンテンツの例を以下に示します。

    <dependencyManagement>
      <dependencies>
        <dependency>
          <groupId>io.quarkus.platform</groupId>
          <artifactId>quarkus-bom</artifactId>
          <version>2.13.Final-redhat-00006</version>
          <type>pom</type>
          <scope>import</scope>
        </dependency>
        <dependency>
          <groupId>io.quarkus.platform</groupId>
          <artifactId>quarkus-optaplanner-bom</artifactId>
          <version>2.13.Final-redhat-00006</version>
          <type>pom</type>
          <scope>import</scope>
        </dependency>
      </dependencies>
    </dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-resteasy</artifactId>
      </dependency>
      <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-resteasy-jackson</artifactId>
      </dependency>
      <dependency>
        <groupId>org.optaplanner</groupId>
        <artifactId>optaplanner-quarkus</artifactId>
      </dependency>
      <dependency>
        <groupId>org.optaplanner</groupId>
        <artifactId>optaplanner-quarkus-jackson</artifactId>
      </dependency>
      <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-junit5</artifactId>
        <scope>test</scope>
      </dependency>
    </dependencies>
    Copy to Clipboard Toggle word wrap
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

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

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

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

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

会社概要

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

Theme

© 2026 Red Hat
トップに戻る