此内容没有您所选择的语言版本。

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

  1. Add the following properties to your Spring Boot application application.properties file:

    kieserver.classPathContainer=true
    kieserver.autoScanDeployments=true
    Expand
    ParameterValuesDescription

    kieserver.classPathContainer

    true, false

    When set to true, KIE Server uses the class loader used by the container to load KJAR files and their dependencies.

    kieserver.autoScanDeployments

    true, false

    When 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 the package-dependencies-kjar Maven goal of the kie-maven-plugin plug-in.

  2. Add the following Maven plug-in in the Spring Boot service/pom.xml file 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 project kjar/pom.xml file.

    Note

    You 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 Evaluation 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>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>
  3. To build the self-contained Spring Boot image, enter the following command in the service directory:

    maven install
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部