此内容没有您所选择的语言版本。
Chapter 3. Java project migration
Projects that you developed in Java code in Red Hat JBoss BRMS 6.4 (for example, in Eclipse) also require modification for Red Hat Decision Manager 7.1. You must update the dependencies in the pom.xml
file for each project and rebuild the project. To migrate your Java client applications, you also must update the dependencies in the pom.xml
file for each project. If your application uses an embedded Red Hat JBoss BRMS 6.4 engine (Drools), this change also updates the engines. If the application calls the Decision Server, the API client library is updated.
3.1. Update Java project dependencies
You must update several dependencies in your Java projects to prepare them for migration to Red Hat Decision Manager 7.1.
Prerequisite
The Maven repository for Red Hat Decision Manager 7.1 has been downloaded from the Red Hat Customer Portal and made available to the local Maven installation (as a local or remote repository).
Procedure
Open the
pom.xml
file of the project and remove the<version>
tag from any dependencies under the following groups:-
org.kie
-
org.drools
-
org.jbpm
-
org.optaplanner
-
Add the Red Hat Business Automation bill of materials (BOM) dependency under the
<dependencies>
tag within the<dependencyManagement>
section:<dependency> <groupId>com.redhat.ba</groupId> <artifactId>ba-platform-bom</artifactId> <version>7.1.0.GA-redhat-00002</version> <scope>import</scope> <type>pom</type> </dependency>
<dependency> <groupId>com.redhat.ba</groupId> <artifactId>ba-platform-bom</artifactId> <version>7.1.0.GA-redhat-00002</version> <scope>import</scope> <type>pom</type> </dependency>
Copy to Clipboard Copied! The Red Hat Business Automation BOM applies to both Red Hat Decision Manager and Red Hat Process Automation Manager. When you add the BOM files, the correct versions of transitive dependencies from the provided Maven repositories are included in the project. The BOM
<version>
is the version of thecom.redhat.ba:ba-platform-bom
Red Hat Business Automation artifact in the Maven repository. You can view the version of the artifact by entering the repository and navigating to themaven-repository/com/redhat/bom/ba/ba-platform-bom
directory.If your code uses any Drools CDI annotations (
@KReleaseId
,@KContainer
,@KBase
,@KSession
), also add the following dependency:<dependency> <groupId>org.drools</groupId> <artifactId>drools-cdi</artifactId> </dependency>
<dependency> <groupId>org.drools</groupId> <artifactId>drools-cdi</artifactId> </dependency>
Copy to Clipboard Copied! This dependency is necessary because the CDI extension for processing the annotations is now defined using a separate module. Without this dependency, the annotations do not work.
Replace the legacy
org.guvnor
dependency (if applicable) with the neworg.uberfire
dependency.Legacy
org.guvnor
dependency:<dependency> <groupId>org.guvnor</groupId> <artifactId>guvnor-rest-client</artifactId> </dependency>
<dependency> <groupId>org.guvnor</groupId> <artifactId>guvnor-rest-client</artifactId> </dependency>
Copy to Clipboard Copied! New
org.uberfire
dependency:<dependency> <groupId>org.uberfire</groupId> <artifactId>uberfire-rest-client</artifactId> </dependency>
<dependency> <groupId>org.uberfire</groupId> <artifactId>uberfire-rest-client</artifactId> </dependency>
Copy to Clipboard Copied! -
Update the version of the project artifact and save the
pom.xml
file.
3.2. Verify the Java project migration
After you have migrated all Java project data, rebuild the Java project to verify a successful migration.
Prerequisites
- Java project dependencies have been updated.
- Maven 3.x or later is installed.
- Java 8 or later is installed.
Procedure
Rebuild each Java project using a regular Maven build.
mvn clean install
$ mvn clean install
Copy to Clipboard Copied! Review all project data in each build to confirm successful migration.
If you encounter build errors, verify that the project dependencies have been updated correctly. To review other product changes that may have impacted your Java project, see Chapter 4, Other migration considerations.