From da919d2e71ccfcdc52158221e0bd420068afee0a Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti Date: Tue, 4 Jun 2024 13:06:42 +0200 Subject: [PATCH] [Fix_#3546] NodeInstanceFactoryProvided not included in native build --- .../common/deployment/KogitoAssetsProcessor.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/quarkus/extensions/kogito-quarkus-extension-common/kogito-quarkus-common-deployment/src/main/java/org/kie/kogito/quarkus/common/deployment/KogitoAssetsProcessor.java b/quarkus/extensions/kogito-quarkus-extension-common/kogito-quarkus-common-deployment/src/main/java/org/kie/kogito/quarkus/common/deployment/KogitoAssetsProcessor.java index 346a0f5a40d..f7fe69b3149 100644 --- a/quarkus/extensions/kogito-quarkus-extension-common/kogito-quarkus-common-deployment/src/main/java/org/kie/kogito/quarkus/common/deployment/KogitoAssetsProcessor.java +++ b/quarkus/extensions/kogito-quarkus-extension-common/kogito-quarkus-common-deployment/src/main/java/org/kie/kogito/quarkus/common/deployment/KogitoAssetsProcessor.java @@ -42,6 +42,8 @@ import org.jboss.jandex.IndexView; import org.jboss.jandex.Indexer; import org.jboss.logging.Logger; +import org.jbpm.ruleflow.core.factory.provider.NodeFactoryProvider; +import org.jbpm.workflow.instance.impl.NodeInstanceFactoryProvider; import org.kie.efesto.quarkus.deployment.EfestoGeneratedClassBuildItem; import org.kie.kogito.KogitoGAV; import org.kie.kogito.codegen.api.Generator; @@ -63,9 +65,11 @@ import io.quarkus.deployment.builditem.LiveReloadBuildItem; import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem; import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; +import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem; import io.quarkus.deployment.index.IndexingUtil; import io.quarkus.deployment.pkg.builditem.CurateOutcomeBuildItem; import io.quarkus.deployment.pkg.builditem.OutputTargetBuildItem; +import io.quarkus.deployment.pkg.steps.NativeOrNativeSourcesBuild; import io.quarkus.maven.dependency.Dependency; import io.quarkus.maven.dependency.ResolvedDependency; import io.quarkus.paths.PathCollection; @@ -157,6 +161,12 @@ public KogitoGeneratedSourcesBuildItem generateSources( return new KogitoGeneratedSourcesBuildItem(generatedFiles); } + @BuildStep(onlyIf = NativeOrNativeSourcesBuild.class) + public void addNativeLoaders(BuildProducer serviceProvider) { + serviceProvider.produce(ServiceProviderBuildItem.allProvidersFromClassPath(NodeInstanceFactoryProvider.class.getCanonicalName())); + serviceProvider.produce(ServiceProviderBuildItem.allProvidersFromClassPath(NodeFactoryProvider.class.getCanonicalName())); + } + @BuildStep public List generateModel( KogitoGeneratedSourcesBuildItem sources,