Chapter 16. Creating a Maven project for a Kogito microservice
Before you can begin developing Kogito microservices, you need to create a Maven project where you can build your assets and any other related resources for your application.
Procedure
- In a command terminal, navigate to a local folder where you want to store the new project.
Enter the following command to generate a project within a defined folder:
On Quarkus
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On Spring Boot
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This command generates a
sample-kogitoMaven 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.xmlfile in the Maven project that contains your Kogito microservices:Dependency to enable PMML execution
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On Quarkus, if you plan to run your application on OpenShift, you must also import the Quarkus
smallrye-healthextension for the liveness and readiness probes, as shown in the following example:SmallRye Health extension for Quarkus applications on OpenShift
mvn quarkus:add-extension -Dextensions="smallrye-health"
$ mvn quarkus:add-extension -Dextensions="smallrye-health"Copy to Clipboard Copied! Toggle word wrap Toggle overflow This command generates the following dependency in the
pom.xmlfile of your Red Hat Decision Manager project on Quarkus:SmallRye Heath dependency for Quarkus applications on OpenShift
<dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-smallrye-health</artifactId> </dependency>
<dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-smallrye-health</artifactId> </dependency>Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Open or import the project in your VSCode IDE to view the contents.