diff --git a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpBinding.java b/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpBinding.java index d5e493a28b4..657eb8f9089 100644 --- a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpBinding.java +++ b/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpBinding.java @@ -167,6 +167,7 @@ protected void doWriteDirectResponse(Message message, HttpServletResponse respon } } finally { IOHelper.close(new Closeable[]{is, os}); + stream.close(); } } else { if (LOG.isDebugEnabled()) { diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/routecontroller/SupervisingRouteControllerAutoConfiguration.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/routecontroller/SupervisingRouteControllerAutoConfiguration.java index dcdc34f9cf0..3b0428213ae 100644 --- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/routecontroller/SupervisingRouteControllerAutoConfiguration.java +++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/routecontroller/SupervisingRouteControllerAutoConfiguration.java @@ -61,7 +61,7 @@ public SupervisingRouteController supervisingRouteController(SupervisingRouteCon src.setBackOffMaxAttempts(config.getBackOffMaxAttempts()); } if (config.getBackOffMaxDelay() > 0) { - src.setBackOffMaxDelay(config.getBackOffDelay()); + src.setBackOffMaxDelay(config.getBackOffMaxDelay()); } if (config.getBackOffMaxElapsedTime() > 0) { src.setBackOffMaxElapsedTime(config.getBackOffMaxElapsedTime()); diff --git a/tooling/camel-spring-boot-generator-maven-plugin/src/main/java/org/apache/camel/springboot/maven/SpringBootAutoConfigurationMojo.java b/tooling/camel-spring-boot-generator-maven-plugin/src/main/java/org/apache/camel/springboot/maven/SpringBootAutoConfigurationMojo.java index 13d5e91e1c6..da2b5947e3f 100644 --- a/tooling/camel-spring-boot-generator-maven-plugin/src/main/java/org/apache/camel/springboot/maven/SpringBootAutoConfigurationMojo.java +++ b/tooling/camel-spring-boot-generator-maven-plugin/src/main/java/org/apache/camel/springboot/maven/SpringBootAutoConfigurationMojo.java @@ -1938,6 +1938,7 @@ private void writeComponentSpringFactorySource(String packageName, String name) FileUtils.write(target, code, StandardCharsets.UTF_8); getLog().info("Created file: " + target); + is.close(); } catch (Exception e) { throw new MojoFailureException("IOError with file " + target, e); } diff --git a/tooling/camel-spring-boot-generator-maven-plugin/src/main/java/org/apache/camel/springboot/maven/SpringBootStarterMojo.java b/tooling/camel-spring-boot-generator-maven-plugin/src/main/java/org/apache/camel/springboot/maven/SpringBootStarterMojo.java index 7a016385ed9..bfcf25779fd 100644 --- a/tooling/camel-spring-boot-generator-maven-plugin/src/main/java/org/apache/camel/springboot/maven/SpringBootStarterMojo.java +++ b/tooling/camel-spring-boot-generator-maven-plugin/src/main/java/org/apache/camel/springboot/maven/SpringBootStarterMojo.java @@ -117,7 +117,9 @@ protected void executeAll() throws MojoExecutionException, MojoFailureException private void fixAdditionalDependencies(Document pom) throws Exception { Properties properties = new Properties(); - properties.load(getClass().getResourceAsStream("/spring-boot-fix-dependencies.properties")); + InputStream is = getClass().getResourceAsStream("/spring-boot-fix-dependencies.properties"); + properties.load(is); + is.close(); Set deps = new TreeSet<>(csvToSet(properties.getProperty(getMainDepArtifactId()))); @@ -233,7 +235,10 @@ private void fixExcludedDependencies(Document pom) throws Exception { // excluded dependencies Set configExclusions = new HashSet<>(); Properties properties = new Properties(); - properties.load(getClass().getResourceAsStream("/spring-boot-fix-dependencies.properties")); + InputStream is = getClass().getResourceAsStream("/spring-boot-fix-dependencies.properties"); + properties.load(is); + is.close(); + String artExcl = properties.getProperty("exclude_" + getMainDepArtifactId()); getLog().debug("Configured exclusions: " + artExcl); if (artExcl != null && !artExcl.trim().isEmpty()) {