此内容没有您所选择的语言版本。
Chapter 6. Creating a self-contained Red Hat Decision Manager Spring Boot JAR file
You can create a self-contained Red Hat Decision Manager Spring Boot JAR file that contains multiple versions of the same KJAR file, including modules. These are files that have the same artifactID and groupID attribute values, but have different version values. The KJAR files are separated from the BOOT-INF/lib JAR files to avoid class loader collisions. Each KJAR classpath container file is isolated from other KJAR classpath container files and does not rely on the Spring Boot class loader.
Prerequisites
- You have a Red Hat Decision Manager Spring Boot project.
Procedure
Add the following properties to your Spring Boot application
application.propertiesfile:kieserver.classPathContainer=true kieserver.autoScanDeployments=trueExpand Parameter Values Description kieserver.classPathContainertrue, falseWhen set to
true, KIE Server uses the class loader used by the container to load KJAR files and their dependencies.kieserver.autoScanDeploymentstrue, falseWhen set to
true, KIE Server scans and deploys all KJAR files available in the Spring Boot application, whether they are declared programmatically or through the Maven plug-in.When both of these properties are set to
true, the Spring Boot KIE Server automatically scans for deployable artifacts that are packaged within the Spring Boot application using thepackage-dependencies-kjarMaven goal of thekie-maven-pluginplug-in.Add the following Maven plug-in in the Spring Boot
service/pom.xmlfile where<GROUP_ID>,<ARTIFACT_ID>, and<VERSION>are the group, artifact, and version (GAV) of an artifact that your project uses. These artifacts are located in the Spring Boot projectkjar/pom.xmlfile.NoteYou can add more than one version of an artifact.
<build> <plugins> <plugin> <groupId>org.kie</groupId> <artifactId>kie-maven-plugin</artifactId> <version>${version.org.kie}</version> <executions> <execution> <id>copy</id> <phase>prepare-package</phase> <goals> <goal>package-dependencies-kjar</goal> </goals> </execution> </executions> <configuration> <artifactItems> <artifactItem> <groupId><GROUP_ID></groupId> <artifactId><ARTIFACT_ID>/artifactId> <version><VERSION></version> </artifactItem> </artifactItems> </configuration> </plugin> <plugins> <build>The artifacts required to run the KJAR will be resolved at build time.
The following example adds two version of the
Evaluationartifact:<build> <plugins> <plugin> <groupId>org.kie</groupId> <artifactId>kie-maven-plugin</artifactId> <version>${version.org.kie}</version> <executions> <execution> <id>copy</id> <phase>prepare-package</phase> <goals> <goal>package-dependencies-kjar</goal> </goals> </execution> </executions> <configuration> <artifactItems> <artifactItem> <groupId>com.myspace</groupId> <artifactId>Evaluation</artifactId> <version>1.0.0-SNAPSHOT</version> </artifactItem> <artifactItem> <groupId>com.myspace</groupId> <artifactId>Evaluation</artifactId> <version>2.0.0-SNAPSHOT</version> </artifactItem> </artifactItems> </configuration> </plugin> <plugins> <build>To build the self-contained Spring Boot image, enter the following command in the
servicedirectory:maven install