From 23e4ef4b640aaf01c76d78c141031562ab437cd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Mu=C3=B1oz?= Date: Wed, 17 Jan 2024 17:41:14 +0100 Subject: [PATCH] [JBPM-10214] Fix regression for immutable KIE container with auto scan (#3004) * [JBPM-10214] Fix regression for immutable KIE container with auto scan * Update kie-spring-boot/kie-spring-boot-autoconfiguration/kie-server-spring-boot-autoconfiguration/src/main/java/org/kie/server/springboot/autoconfiguration/KieServerAutoConfiguration.java Co-authored-by: Francisco Javier Tirado Sarti <65240126+fjtirado@users.noreply.github.com> --------- Co-authored-by: gmunozfe Co-authored-by: Francisco Javier Tirado Sarti <65240126+fjtirado@users.noreply.github.com> --- .../autoconfiguration/KieServerAutoConfiguration.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kie-spring-boot/kie-spring-boot-autoconfiguration/kie-server-spring-boot-autoconfiguration/src/main/java/org/kie/server/springboot/autoconfiguration/KieServerAutoConfiguration.java b/kie-spring-boot/kie-spring-boot-autoconfiguration/kie-server-spring-boot-autoconfiguration/src/main/java/org/kie/server/springboot/autoconfiguration/KieServerAutoConfiguration.java index 4639b71fd3..2eb1b5f91e 100644 --- a/kie-spring-boot/kie-spring-boot-autoconfiguration/kie-server-spring-boot-autoconfiguration/src/main/java/org/kie/server/springboot/autoconfiguration/KieServerAutoConfiguration.java +++ b/kie-spring-boot/kie-spring-boot-autoconfiguration/kie-server-spring-boot-autoconfiguration/src/main/java/org/kie/server/springboot/autoconfiguration/KieServerAutoConfiguration.java @@ -173,7 +173,8 @@ public List buildDeployments(KieServerProperties kieServer public List buildAutoScanDeployments(KieServerProperties kieServerProperties) throws IOException { ApplicationHome appHome = new ApplicationHome(); final String folder = "BOOT-INF/classes/KIE-INF/lib/"; - return (explodedJarFolder == null) ? discoverDeployments(folder, new FileInputStream(appHome.getSource())) : discoverDeployments(folder, new File(explodedJarFolder)); + List containerResources = discoverDeployments(folder, new File(explodedJarFolder)); + return containerResources.isEmpty() ? discoverDeployments(folder, new FileInputStream(appHome.getSource())) : containerResources; } public List discoverDeployments(String folder, File root) {