You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "gitgabrio (via GitHub)" <gi...@apache.org> on 2025/01/22 14:46:04 UTC

[I] kogito.codegen.* properties ignored in springboot applications [incubator-kie-issues]

gitgabrio opened a new issue, #1775:
URL: https://github.com/apache/incubator-kie-issues/issues/1775

   This impact all kogito-springboot applications
   
   kogito.codegen.(engine_name) properties are used to enable/disable overall code-generation.
   Those works as expected in quarkus application, and are documented in that way in our docs.
   Inside springboot applications, those seems ignored.
   On debugging, the problem lies in
   org.kie.kogito.maven.plugin.AbstractKieMojo:
   
   1. there are system properties (l[ines 76-89)](https://github.com/apache/incubator-kie-kogito-runtimes/blob/61795df025308bd4bdd9da1a651cbe43bb1721d3/kogito-maven-plugin/src/main/java/org/kie/kogito/maven/plugin/AbstractKieMojo.java#L76) that are "true" by default
   2. at [line 189](https://github.com/apache/incubator-kie-kogito-runtimes/blob/61795df025308bd4bdd9da1a651cbe43bb1721d3/kogito-maven-plugin/src/main/java/org/kie/kogito/maven/plugin/AbstractKieMojo.java#L189), a SpringBootKogitoBuildContext.Builder is instantiated
   3. after that, [AbstractKogitoBuildContext.load()](https://github.com/apache/incubator-kie-kogito-runtimes/blob/61795df025308bd4bdd9da1a651cbe43bb1721d3/kogito-codegen-modules/kogito-codegen-api/src/main/java/org/kie/kogito/codegen/api/context/impl/AbstractKogitoBuildContext.java#L94) method is invoked, which load properties from application.properties and put them in the application context
   4. after that, [AbstractKieMojo#176-181](https://github.com/apache/incubator-kie-kogito-runtimes/blob/61795df025308bd4bdd9da1a651cbe43bb1721d3/kogito-maven-plugin/src/main/java/org/kie/kogito/maven/plugin/AbstractKieMojo.java#L177) overwrite the "codegen" properties with the ones defined at 76-89, and since those are "true" by default (if none has been provided) the codegen properties are always "true" when [org.kie.kogito.codegen.api.Generator#isEnabled()](https://github.com/apache/incubator-kie-kogito-runtimes/blob/61795df025308bd4bdd9da1a651cbe43bb1721d3/kogito-codegen-modules/kogito-codegen-api/src/main/java/org/kie/kogito/codegen/api/Generator.java#L72) is invoked
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [I] kogito.codegen.* properties ignored in springboot applications [incubator-kie-issues]

Posted by "gitgabrio (via GitHub)" <gi...@apache.org>.
gitgabrio closed issue #1775: kogito.codegen.* properties ignored in springboot applications
URL: https://github.com/apache/incubator-kie-issues/issues/1775


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org