Hello, Over the last years, we have been working on adding Gradle support for building Kogito projects, both for Spring Boot‑based and Quarkus‑based applications. This feature has been requested several times by the Apache KIE community, for example:
- https://github.com/apache/incubator-kie-kogito-runtimes/issues/3565 - https://github.com/apache/incubator-kie-drools/issues/6478 We are happy to share that the implementation is now complete and ready for review and eventual merging into the Apache KIE codebase - *kogito-drools* - Minor change to better detect the used building system (Maven / Gradle) - [incubator-kie-issues#1918] Fix building tool discovery by gitgabrio · Pull Request #6580 · apache/incubator-kie-drools <https://github.com/apache/incubator-kie-drools/pull/6580> - *kogito-runtimes* - New `kogito-gradle-plugin` and its integration test module added - [incubator-kie-issues#1918] Implement GRADLE plugin by gitgabrio · Pull Request #4180 · apache/incubator-kie-kogito-runtimes <https://github.com/apache/incubator-kie-kogito-runtimes/pull/4180> - *kogito-examples* - A new top-level directory (`gradle-examples`) containing one Spring Boot example and one Quarkus example - [incubator-kie-issues#1839] Implement GRADLE examples by gitgabrio · Pull Request #2163 · apache/incubator-kie-kogito-examples <https://github.com/apache/incubator-kie-kogito-examples/pull/2163> To achieve this, some preliminary refactoring was required to support two (and potentially more) build systems. Most of the logic previously contained in the `kogito-maven-plugin` has been moved into a new shared module, `kogito-codegen-manager*`*, which can now be reused by different plugins. Relevant issues include: - https://github.com/apache/incubator-kie-issues/issues/1068 - https://github.com/apache/incubator-kie-issues/issues/1910 - https://github.com/apache/incubator-kie-issues/issues/1068 - https://github.com/apache/incubator-kie-issues/issues/2193 The strategies used to enable Gradle support follow the same approach already used with Maven: - *Quarkus-based Kogito projects:* The `quarkus-gradle-plugin` will be used to build the project, mirroring the strategy already adopted with the `quarkus-maven-plugin`. - *Spring Boot-based Kogito projects:* A new `kogito-gradle-plugin` will be introduced. Its main purpose is to manage the code generation phase in the same way as the existing `kogito-maven-plugin`. Both plugins rely on the common logic provided by the `kogito-codegen-manager` module. There are no breaking changes introduced with Gradle support. No changes are required in the CI environment or on developers’ local machines. All newly introduced Gradle‑based modules will continue to be managed by Maven, which will invoke them through the `exec-maven-plugin` and the `gradlew` wrapper. This means that Gradle does *not* need to be installed on either the CI infrastructure or local development machines. The work is currently tracked in the following tickets: - kie-issues#1918: Create a Gradle plugin to be a wrapper of the codegen library [1] - kie-issues#1839: Create gradle-based kogito-examples [2] The implementation part will be managed in 2 different phases: Phase 1: A PR for `kie-issues#1918` `Create a Gradle plugin to be a wrapper of the codegen library` will be created. This will introduce the new `kogito-gradle-plugin` Phase 2: A PR for `kie-issues#1839`: `Create gradle-based kogito-examples`. Phase 2 will be executed *after* the Quarkus update to 3.27.2 currently in progress [3], in order to base our testing phase to target the upcoming Quarkus version. Kudos to Gabriele Cardosi, who led this effort as the main author. Thank you, Yeser Amer [1] https://github.com/apache/incubator-kie-issues/issues/1918 [2] https://github.com/apache/incubator-kie-issues/issues/1839 [3] https://lists.apache.org/thread/9rjfbp8kv0v6b24dg2dtpmcq7qd254ms
