diff --git a/src/main/java/tech/jhipster/lite/module/domain/mavenplugin/JHipsterModuleMavenPlugins.java b/src/main/java/tech/jhipster/lite/module/domain/mavenplugin/JHipsterModuleMavenPlugins.java index e32f2bc6f81..5c50830d4ad 100644 --- a/src/main/java/tech/jhipster/lite/module/domain/mavenplugin/JHipsterModuleMavenPlugins.java +++ b/src/main/java/tech/jhipster/lite/module/domain/mavenplugin/JHipsterModuleMavenPlugins.java @@ -79,12 +79,8 @@ private static Function toAddMavenPlu .stream() .flatMap(toDependencyVersion(versions, projectDependencies)) .forEach(commandBuilder::addDependencyVersion); - return plugin - .versionSlug() - .map(versions::get) - .map(commandBuilder::pluginVersion) - .map(AddMavenPluginOptionalBuilder::build) - .orElse(commandBuilder.build()); + plugin.versionSlug().map(versions::get).ifPresent(commandBuilder::pluginVersion); + return commandBuilder.build(); }; }