diff --git a/kogito-codegen-modules/kogito-codegen-core/src/main/java/org/kie/kogito/codegen/core/ApplicationConfigGenerator.java b/kogito-codegen-modules/kogito-codegen-core/src/main/java/org/kie/kogito/codegen/core/ApplicationConfigGenerator.java index d90aecaeb60..13cc45a11f7 100644 --- a/kogito-codegen-modules/kogito-codegen-core/src/main/java/org/kie/kogito/codegen/core/ApplicationConfigGenerator.java +++ b/kogito-codegen-modules/kogito-codegen-core/src/main/java/org/kie/kogito/codegen/core/ApplicationConfigGenerator.java @@ -74,7 +74,7 @@ public Collection generate() { generatedFiles.add(generateApplicationConfigDescriptor(configClassNames)); - if (context.hasDI()) { + if (context.hasDI() && context.hasRESTGloballyAvailable()) { generatedFiles.add(ObjectMapperGenerator.generate(context)); } diff --git a/kogito-codegen-modules/kogito-codegen-core/src/main/java/org/kie/kogito/codegen/core/ObjectMapperGenerator.java b/kogito-codegen-modules/kogito-codegen-core/src/main/java/org/kie/kogito/codegen/core/ObjectMapperGenerator.java index b496679da1d..cf09d3a2108 100644 --- a/kogito-codegen-modules/kogito-codegen-core/src/main/java/org/kie/kogito/codegen/core/ObjectMapperGenerator.java +++ b/kogito-codegen-modules/kogito-codegen-core/src/main/java/org/kie/kogito/codegen/core/ObjectMapperGenerator.java @@ -16,7 +16,7 @@ package org.kie.kogito.codegen.core; import org.kie.kogito.codegen.api.GeneratedFile; -import org.kie.kogito.codegen.api.GeneratedFileType; +import org.kie.kogito.codegen.api.Generator; import org.kie.kogito.codegen.api.context.KogitoBuildContext; import org.kie.kogito.codegen.api.template.TemplatedGenerator; @@ -25,14 +25,12 @@ public class ObjectMapperGenerator { private ObjectMapperGenerator() { } - private static final GeneratedFileType JSON_MAPPER_TYPE = GeneratedFileType.of("JSON_MAPPER", GeneratedFileType.Category.SOURCE); - public static GeneratedFile generate(KogitoBuildContext context) { TemplatedGenerator generator = TemplatedGenerator.builder() .withTemplateBasePath("class-templates/config") .build(context, "GlobalObjectMapper"); - return new GeneratedFile(JSON_MAPPER_TYPE, + return new GeneratedFile(Generator.REST_TYPE, generator.generatedFilePath(), generator.compilationUnitOrThrow().toString()); } diff --git a/quarkus/extensions/kogito-quarkus-extension-common/kogito-quarkus-common/pom.xml b/quarkus/extensions/kogito-quarkus-extension-common/kogito-quarkus-common/pom.xml index 68a2e6ca4d0..c42f70b770b 100644 --- a/quarkus/extensions/kogito-quarkus-extension-common/kogito-quarkus-common/pom.xml +++ b/quarkus/extensions/kogito-quarkus-extension-common/kogito-quarkus-common/pom.xml @@ -55,6 +55,12 @@ provided + + io.quarkus + quarkus-jackson + provided + + io.quarkus quarkus-arc diff --git a/quarkus/extensions/kogito-quarkus-rules-extension/kogito-quarkus-rules/pom.xml b/quarkus/extensions/kogito-quarkus-rules-extension/kogito-quarkus-rules/pom.xml index 6a4e32a921a..4baf38d3ea3 100644 --- a/quarkus/extensions/kogito-quarkus-rules-extension/kogito-quarkus-rules/pom.xml +++ b/quarkus/extensions/kogito-quarkus-rules-extension/kogito-quarkus-rules/pom.xml @@ -24,6 +24,11 @@ org.kie.kogito kogito-api-incubation-rules-services + + io.quarkus + quarkus-jackson + provided +