이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 3. Creating a Maven project for a Red Hat build of Kogito microservice


Before you can begin developing Red Hat build of Kogito microservices, you need to create a Maven project where you can build your assets and any other related resources for your application.

Procedure

  1. In a command terminal, navigate to a local folder where you want to store the new project.
  2. Enter the following command to generate a project within a defined folder:

    On Red Hat build of Quarkus

    $ mvn io.quarkus:quarkus-maven-plugin:create \
        -DprojectGroupId=org.acme -DprojectArtifactId=sample-kogito \
        -DprojectVersion=1.0.0-SNAPSHOT -Dextensions=kogito-quarkus
    Copy to Clipboard Toggle word wrap

    On Spring Boot

    $ mvn archetype:generate \
        -DarchetypeGroupId=org.kie.kogito \
        -DarchetypeArtifactId=kogito-spring-boot-archetype \
        -DgroupId=org.acme -DartifactId=sample-kogito \
        -DarchetypeVersion=1.11.0.Final \
        -Dversion=1.0-SNAPSHOT
    Copy to Clipboard Toggle word wrap

    This command generates a sample-kogito Maven project and imports the extension for all required dependencies and configurations to prepare your application for business automation.

    If you want to enable PMML execution for your project, add the following dependency to the pom.xml file in the Maven project that contains your Red Hat build of Kogito microservices:

    Dependency to enable PMML execution

    <dependency>
      <groupId>org.kie.kogito</groupId>
      <artifactId>kogito-pmml</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jpmml</groupId>
      <artifactId>pmml-model</artifactId>
    </dependency>
    Copy to Clipboard Toggle word wrap

    On Red Hat build of Quarkus, if you plan to run your application on OpenShift, you must also import the smallrye-health extension for the liveness and readiness probes, as shown in the following example:

    SmallRye Health extension for Red Hat build of Quarkus applications on OpenShift

    $ mvn quarkus:add-extension -Dextensions="smallrye-health"
    Copy to Clipboard Toggle word wrap

    This command generates the following dependency in the pom.xml file of your Red Hat Decision Manager project on Red Hat build of Quarkus:

    SmallRye Health dependency for Red Hat build of Quarkus applications on OpenShift

    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-smallrye-health</artifactId>
    </dependency>
    Copy to Clipboard Toggle word wrap

  3. Open or import the project in your VS Code IDE to view the contents.

3.1. Creating a custom Spring Boot project for Red Hat build of Kogito microservices

You can create custom Maven projects using the Spring Boot archetype for your Red Hat build of Kogito microservices. The Spring Boot archetype enables you to add Spring Boot starters or add-ons to your project.

A Spring Boot starter is an all-in-one descriptor for your project and requires business automation engines provided by Red Hat build of Kogito. The Spring Boot starters include decisions, rules, and predictions.

When your project contains all the assets and you want a quick way to get started with Red Hat build of Kogito, you can use the kogito-spring-boot-starter starter. For a more granular approach, you can use a specific starter, such as kogito-decisions-spring-boot-starter for decisions, or a combination of starters.

Red Hat build of Kogito supports the following Spring Boot starters:

Decisions Spring Boot starter

Starter for providing DMN support to your Spring Boot project. The following is an example of adding a decisions Spring boot starter to your project:

<dependencies>
  <dependency>
    <groupId>org.kie.kogito</groupId>
    <artifactId>kogito-decisions-spring-boot-starter</artifactId>
  </dependency>
</dependencies>
Copy to Clipboard Toggle word wrap
Predictions Spring Boot starter

Starter for providing PMML support to your Spring Boot project. The following is an example of adding a predictions Spring boot starter to your project:

<dependencies>
  <dependency>
    <groupId>org.kie.kogito</groupId>
    <artifactId>kogito-predictions-spring-boot-starter</artifactId>
  </dependency>
</dependencies>
Copy to Clipboard Toggle word wrap
Rules Spring Boot starter

Starter for providing DRL support to your Spring Boot project. The following is an example of adding a rules Spring boot starter to your project:

<dependencies>
  <dependency>
    <groupId>org.kie.kogito</groupId>
    <artifactId>kogito-rules-spring-boot-starter</artifactId>
  </dependency>
</dependencies>
Copy to Clipboard Toggle word wrap

Procedure

  1. In a command terminal, navigate to a local folder where you want to store the new project.
  2. Enter one of the following commands to generate a project using the starters or addons property:

    • To generate a project using the starters property, enter the following command:

      $ mvn archetype:generate \
          -DarchetypeGroupId=org.kie.kogito \
          -DarchetypeArtifactId=kogito-springboot-archetype \
          -DgroupId=org.acme -DartifactId=sample-kogito \
          -DarchetypeVersion=1.11.0.Final \
          -Dversion=1.0-SNAPSHOT
          -Dstarters=decisions
      Copy to Clipboard Toggle word wrap

      The new project includes the dependencies required to run the decision microservices. You can combine multiple Spring Boot starters using a comma-separated list, such as starters=decisions,rules.

    • To generate a project containing Prometheus monitoring using the addons property, enter the following command:

      $ mvn archetype:generate \
          -DarchetypeGroupId=org.kie.kogito \
          -DarchetypeArtifactId=kogito-springboot-archetype \
          -DgroupId=org.acme -DartifactId=sample-kogito \
          -DarchetypeVersion=1.11.0.Final \
          -Dversion=1.0-SNAPSHOT
          -Dstarters=descisions
          -Daddons=monitoring-prometheus,persistence-infinispan
      Copy to Clipboard Toggle word wrap
      Note

      When you pass an add-on to the property, the add-on name does not require the kogito-addons-springboot prefix. Also, you can combine the add-ons and starters properties to customize the project.

  3. Open or import the project in your IDE to view the contents.
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat