A.3. リモート Jakarta Enterprise Beans クライアントのプロジェクト依存関係

リモートクライアントからのセッション Bean の呼び出しが含まれる Maven プロジェクトでは、JBoss EAP Maven リポジトリーから以下の依存関係が必要になります。以下のサブセクションで説明されているように、Jakarta Enterprise Beans クライアントの依存関係を宣言する方法があります。

注記

artifactId バージョンが変更される可能性があります。最新バージョンは、JBoss EAP Maven リポジトリーを参照してください。

リモート Jakarta Enterprise Beans クライアントの Maven 依存関係

jboss-eap-jakartaee8 Bill of Materials (BOM) は、JBoss EAP アプリケーションで通常必要とされる多くのアーティファクトの正しいバージョンをパッケージ化します。BOM 依存関係は、import の範囲で pom.xml<dependencyManagement> セクションで指定されています。

例: POM ファイル <dependencyManagement> セクション

<dependencyManagement>
   <dependencies>
      <dependency>
      <groupId>org.jboss.bom</groupId>
        <artifactId>jboss-eap-jakartaee8</artifactId>
        <version>7.4.0.GA</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
   </dependencies>
</dependencyManagement>

残りの依存関係は、pom.xml ファイルの <dependencies> セクションで指定されます。

例: POM ファイル <dependencies> セクション

<dependencies>
    <!-- Include the Enterprise Java Bean client JARs -->
    <dependency>
        <groupId>org.jboss.eap</groupId>
        <artifactId>wildfly-ejb-client-bom</artifactId>
        <type>pom</type>
    </dependency>

    <!-- Include any additional dependencies required by the application
        ...
    -->

</dependencies>

JBoss EAP に同梱される ejb-remote クイックスタートは、リモート Jakarta Enterprise Beans クライアントアプリケーションの完全な動作例が含まれます。リモートセッション Bean 呼び出しの依存関係設定の完全な例については、クイックスタートのルートディレクトリーにある client/pom.xml ファイルを参照してください。

jboss-ejb-client 依存関係の単一のアーティファクト ID

wildfly-ejb-client-bom artifactID を使用し、jboss-ejb-client ライブラリーを追加して Jakarta Enterprise Beans クライアントに必要な依存関係をすべて含めることができます。

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.jboss.eap</groupId>
            <artifactId>wildfly-ejb-client-bom</artifactId>
            <version>JAKARTA_ENTERPRISE_BEANS_CLIENT_BOM_VERSION</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
<dependencies>
    <dependency>
        <groupId>org.jboss</groupId>
        <artifactId>jboss-ejb-client</artifactId>
    </dependency>
</dependencies>

JBoss EAP Maven リポジトリーで利用可能な JAKARTA_ENTERPRISE_BEANS_CLIENT_BOM_VERSION を使用する必要があります。