diff --git a/src/main/java/tech/jhipster/lite/module/domain/JHipsterModulesApplyer.java b/src/main/java/tech/jhipster/lite/module/domain/JHipsterModulesApplyer.java index 57f2a42a49a..08050e2e5ee 100644 --- a/src/main/java/tech/jhipster/lite/module/domain/JHipsterModulesApplyer.java +++ b/src/main/java/tech/jhipster/lite/module/domain/JHipsterModulesApplyer.java @@ -22,11 +22,7 @@ import tech.jhipster.lite.module.domain.properties.JHipsterProjectFolder; import tech.jhipster.lite.module.domain.replacement.ContentReplacer; import tech.jhipster.lite.module.domain.replacement.ContentReplacers; -import tech.jhipster.lite.module.domain.startupcommand.DockerComposeStartupCommandLine; -import tech.jhipster.lite.module.domain.startupcommand.GradleStartupCommandLine; -import tech.jhipster.lite.module.domain.startupcommand.JHipsterStartupCommand; -import tech.jhipster.lite.module.domain.startupcommand.JHipsterStartupCommands; -import tech.jhipster.lite.module.domain.startupcommand.MavenStartupCommandLine; +import tech.jhipster.lite.module.domain.startupcommand.*; import tech.jhipster.lite.shared.error.domain.Assert; @SuppressWarnings("java:S6539") @@ -137,15 +133,11 @@ private JHipsterTemplatedFiles buildTemplatedFiles(JHipsterModule module) { } private JHipsterStartupCommands buildStartupCommands(JHipsterModule module) { - if (detectedJavaBuildTool(module).isEmpty()) { + Optional javaBuildTool = detectedJavaBuildTool(module); + if (javaBuildTool.isEmpty()) { return module.startupCommands(); } - var filteredCommands = module - .startupCommands() - .get() - .stream() - .filter(isStartupCommandCompatibleWith(detectedJavaBuildTool(module).get())) - .toList(); + var filteredCommands = module.startupCommands().get().stream().filter(isStartupCommandCompatibleWith(javaBuildTool.get())).toList(); return new JHipsterStartupCommands(filteredCommands); }