第9章 プロジェクトでの Maven 依存関係の設定
外部の Maven リポジトリーを使用してプロジェクトをデプロイします。プロジェクトを作成すると、Business Central は、Business Central に設定する Maven リポジトリーを使用します。Maven グローバルまたはユーザー設定を使用して、以下のファイルを修正することで、Red Hat Process Automation Manager の公開リポジトリーから依存関係を取得するように、すべての Red Hat Process Automation Manager プロジェクトを指定します。
-
Maven
settings.xml
ファイル。 -
Maven プロジェクトオブジェクトモデル (POM) ファイル (
pom.xml
)。
詳細は『Packaging and deploying a Red Hat Decision Manager project』を参照してください。
9.1. Maven 設定ファイルの修正 リンクのコピーリンクがクリップボードにコピーされました!
組み込みリポジトリーの代わりに、Nexus などの外部 Maven リポジトリーを使用するように Business Central および Process Server を設定できます。この場合、Business Central でプロジェクトをビルドする際に、ビルドしたプロジェクトの全 KJAR ファイルがこの外部リポジトリーにプッシュされます。統合プロセスを実装する場合に、必要に応じてリポジトリーからこのファイルを処理し、Business Central または Process Server REST API を使用して KJAR ファイルをデプロイできます。
前提条件/事前作業
Business Central および Process Server がインストールされている。インストールオプションは『Red Hat Process Automation Manager インストールの計画』を参照してください。
手順
-
外部リポジトリーの接続およびアクセスの詳細が含まれる Maven
settings.xml
ファイルを作成します。settings.xml
ファイルの詳細は Maven の 『Settings Reference』を参照してください。 -
既知の場所 (例:
/opt/custom-config/settings.xml
) にファイルを保存します。 -
Red Hat Process Automation Manager インストールディレクトリーで、
standalone-full.xml
ファイルに移動します。たとえば、Red Hat Process Automation Manager に Red Hat JBoss EAP インストールを使用する場合は$EAP_HOME/standalone/configuration/standalone-full.xml
に移動します。 standalone-full.xml
の<system-properties>
タグで、kie.maven.settings.custom
プロパティーにsettings.xml
ファイルのフルパス名を設定します。以下に例を示します。
<property name="kie.maven.settings.custom" value="/opt/custom-config/settings.xml"/>
<property name="kie.maven.settings.custom" value="/opt/custom-config/settings.xml"/>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Business Central および Process Server を起動します。
9.2. Maven POM ファイルの修正 リンクのコピーリンクがクリップボードにコピーされました!
Red Hat Process Automation Manager プロジェクトで適切な Maven 依存関係を使用するには、プロジェクトの pom.xml
ファイルに Red Hat Business Automation の BOM (bill of materials) ファイルを追加します。Red Hat Business Automation BOM は、Red Hat Decision Manager と Red Hat Process Automation Manager の両方に適用されます。BOM ファイルを追加すると、提供される Maven リポジトリーから、推移的依存関係の適切なバージョンがプロジェクトに含められます。
Red Hat Business Automation BOM (Bill of Materials) についての詳細情報は、「What is the mapping between Red Hat Process Automation Manager and the Maven library version?」を参照してください。
手順
Red Hat Business Automation BOM を
pom.xml
ファイルで宣言します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
<dependencies>
タグでお使いのプロジェクトに必要な依存関係を宣言します。製品の BOM をプロジェクトにインポートしたら、ユーザー向け製品依存関係のバージョンが定義されるため、<dependency>
要素のサブ要素<version>
を指定する必要はありません。ただし、<dependency>
要素を使用して、プロジェクトで使用する依存関係を宣言する必要があります。 Business Central に作成されない標準のプロジェクトでは、お使いのプロジェクトに必要な依存関係をすべて指定します。Business Central に作成するプロジェクトでは、基本的なプロセスエンジンの依存関係が Business Central に自動的に提供されます。
標準的な Red Hat Process Automation Manager プロジェクトでは、使用する機能に応じて、以下の依存関係を宣言します。
埋め込みプロセスエンジン依存関係
Copy to Clipboard Copied! Toggle word wrap Toggle overflow CDI を使用する Red Hat Process Automation Manager プロジェクトでは、通常、以下の依存関係を宣言します。
CDI が有効化されたプロセスエンジンの依存関係
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 標準的な Red Hat Process Automation Manager プロジェクトでは、以下の依存関係を宣言します。
埋め込みプロセスエンジン依存関係
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Process Server を使用するには、以下の依存関係を宣言します。
クライアントアプリケーションの Process Server 依存関係
<dependency> <groupId>org.kie.server</groupId> <artifactId>kie-server-client</artifactId> </dependency>
<dependency> <groupId>org.kie.server</groupId> <artifactId>kie-server-client</artifactId> </dependency>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Red Hat Process Automation Manager にリモートクライアントを作成するには、以下の依存関係を宣言します。
クライアントの依存関係
<dependency> <groupId>org.uberfire</groupId> </dependency>
<dependency> <groupId>org.uberfire</groupId> </dependency>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ルール、プロセス定義など、アセットを含む JAR ファイルを作成する場合は、お使いの Maven プロジェクトのパッケージングの種類を
kjar
とし、org.kie:kie-maven-plugin
を使用して、<project>
要素に置かれたkjar
パッケージングタイプを処理します。以下の例の${kie.version}
は、「What is the mapping between Red Hat Process Automation Manager and the Maven library version?」に記載されている Maven ライブラリーのバージョンです。Copy to Clipboard Copied! Toggle word wrap Toggle overflow