From 5dcdc4c1859117c0b7b31ef7fa66fcaaa0aec431 Mon Sep 17 00:00:00 2001 From: Janne Valkealahti Date: Sun, 19 Dec 2021 12:31:22 +0000 Subject: [PATCH] Extract autoconfig - Create separate spring-shell-autoconfigure and keep all autoconfig features there. - Fixes #329 --- pom.xml | 6 +++ spring-shell-autoconfigure/pom.xml | 45 +++++++++++++++++++ .../ApplicationRunnerAutoConfiguration.java | 3 +- .../CommandRegistryAutoConfiguration.java | 5 ++- .../boot}/CompleterAutoConfiguration.java | 6 ++- ...derParameterResolverAutoConfiguration.java | 7 +-- .../shell/boot}/JLineAutoConfiguration.java | 2 +- .../boot}/JLineShellAutoConfiguration.java | 20 ++------- .../boot}/LineReaderAutoConfiguration.java | 3 +- .../boot}/SpringShellAutoConfiguration.java | 6 ++- .../StandardCommandsAutoConfiguration.java | 12 ++++- .../main/resources/META-INF/spring.factories | 10 +++++ .../java/org/springframework/shell/Utils.java | 16 ++++++- .../shell/jline/ExtendedDefaultParser.java | 4 +- .../shell/jline/ParsedLineInput.java | 12 ++--- .../main/resources/META-INF/spring.factories | 8 ---- spring-shell-docs/pom.xml | 2 +- .../main/resources/META-INF/spring.factories | 2 - .../shell/samples/noautoconf/NoAutoConf.java | 8 ++-- .../main/resources/META-INF/spring.factories | 2 - spring-shell-starter/pom.xml | 10 +++-- 21 files changed, 133 insertions(+), 56 deletions(-) create mode 100644 spring-shell-autoconfigure/pom.xml rename {spring-shell-core/src/main/java/org/springframework/shell => spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot}/ApplicationRunnerAutoConfiguration.java (96%) rename {spring-shell-core/src/main/java/org/springframework/shell => spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot}/CommandRegistryAutoConfiguration.java (85%) rename {spring-shell-core/src/main/java/org/springframework/shell => spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot}/CompleterAutoConfiguration.java (91%) rename {spring-shell-jcommander-adapter/src/main/java/org/springframework/shell/jcommander => spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot}/JCommanderParameterResolverAutoConfiguration.java (81%) rename {spring-shell-core/src/main/java/org/springframework/shell => spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot}/JLineAutoConfiguration.java (96%) rename {spring-shell-core/src/main/java/org/springframework/shell/jline => spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot}/JLineShellAutoConfiguration.java (73%) rename {spring-shell-core/src/main/java/org/springframework/shell => spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot}/LineReaderAutoConfiguration.java (97%) rename {spring-shell-core/src/main/java/org/springframework/shell => spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot}/SpringShellAutoConfiguration.java (94%) rename {spring-shell-standard-commands/src/main/java/org/springframework/shell/standard/commands => spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot}/StandardCommandsAutoConfiguration.java (83%) create mode 100644 spring-shell-autoconfigure/src/main/resources/META-INF/spring.factories delete mode 100644 spring-shell-jcommander-adapter/src/main/resources/META-INF/spring.factories delete mode 100644 spring-shell-standard-commands/src/main/resources/META-INF/spring.factories diff --git a/pom.xml b/pom.xml index effb3641..774a7048 100644 --- a/pom.xml +++ b/pom.xml @@ -36,6 +36,7 @@ spring-shell-docs spring-shell-dependencies spring-shell-starter + spring-shell-autoconfigure @@ -75,6 +76,11 @@ spring-shell-table 3.0.0-SNAPSHOT + + org.springframework.shell + spring-shell-autoconfigure + 3.0.0-SNAPSHOT + org.jline jline diff --git a/spring-shell-autoconfigure/pom.xml b/spring-shell-autoconfigure/pom.xml new file mode 100644 index 00000000..f00295d3 --- /dev/null +++ b/spring-shell-autoconfigure/pom.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + + spring-shell-autoconfigure + Spring Shell Autoconfigure + jar + + + org.springframework.shell + spring-shell-parent + 3.0.0-SNAPSHOT + + + + + org.springframework.boot + spring-boot-autoconfigure + + + org.springframework.shell + spring-shell-core + + + org.springframework.shell + spring-shell-standard-commands + true + + + com.beust + jcommander + true + + + org.springframework.shell + spring-shell-jcommander-adapter + true + + + org.springframework.boot + spring-boot-starter-test + test + + + diff --git a/spring-shell-core/src/main/java/org/springframework/shell/ApplicationRunnerAutoConfiguration.java b/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/ApplicationRunnerAutoConfiguration.java similarity index 96% rename from spring-shell-core/src/main/java/org/springframework/shell/ApplicationRunnerAutoConfiguration.java rename to spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/ApplicationRunnerAutoConfiguration.java index ed4fe057..e31d54d4 100644 --- a/spring-shell-core/src/main/java/org/springframework/shell/ApplicationRunnerAutoConfiguration.java +++ b/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/ApplicationRunnerAutoConfiguration.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.shell; +package org.springframework.shell.boot; import org.jline.reader.LineReader; import org.jline.reader.Parser; @@ -25,6 +25,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.Environment; +import org.springframework.shell.Shell; import org.springframework.shell.jline.InteractiveShellApplicationRunner; import org.springframework.shell.jline.PromptProvider; import org.springframework.shell.jline.ScriptShellApplicationRunner; diff --git a/spring-shell-core/src/main/java/org/springframework/shell/CommandRegistryAutoConfiguration.java b/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/CommandRegistryAutoConfiguration.java similarity index 85% rename from spring-shell-core/src/main/java/org/springframework/shell/CommandRegistryAutoConfiguration.java rename to spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/CommandRegistryAutoConfiguration.java index eabdc23a..8563fab8 100644 --- a/spring-shell-core/src/main/java/org/springframework/shell/CommandRegistryAutoConfiguration.java +++ b/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/CommandRegistryAutoConfiguration.java @@ -13,11 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.shell; +package org.springframework.shell.boot; import org.springframework.beans.factory.ObjectProvider; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.shell.CommandRegistry; +import org.springframework.shell.ConfigurableCommandRegistry; +import org.springframework.shell.MethodTargetRegistrar; @Configuration(proxyBeanMethods = false) public class CommandRegistryAutoConfiguration { diff --git a/spring-shell-core/src/main/java/org/springframework/shell/CompleterAutoConfiguration.java b/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/CompleterAutoConfiguration.java similarity index 91% rename from spring-shell-core/src/main/java/org/springframework/shell/CompleterAutoConfiguration.java rename to spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/CompleterAutoConfiguration.java index 50c81b5f..7d77e2ea 100644 --- a/spring-shell-core/src/main/java/org/springframework/shell/CompleterAutoConfiguration.java +++ b/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/CompleterAutoConfiguration.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.shell; +package org.springframework.shell.boot; import java.util.List; import java.util.stream.Collectors; @@ -26,6 +26,10 @@ import org.jline.reader.ParsedLine; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.shell.CompletingParsedLine; +import org.springframework.shell.CompletionContext; +import org.springframework.shell.CompletionProposal; +import org.springframework.shell.Shell; @Configuration public class CompleterAutoConfiguration { diff --git a/spring-shell-jcommander-adapter/src/main/java/org/springframework/shell/jcommander/JCommanderParameterResolverAutoConfiguration.java b/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/JCommanderParameterResolverAutoConfiguration.java similarity index 81% rename from spring-shell-jcommander-adapter/src/main/java/org/springframework/shell/jcommander/JCommanderParameterResolverAutoConfiguration.java rename to spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/JCommanderParameterResolverAutoConfiguration.java index 4c9c6a2c..da8681a1 100644 --- a/spring-shell-jcommander-adapter/src/main/java/org/springframework/shell/jcommander/JCommanderParameterResolverAutoConfiguration.java +++ b/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/JCommanderParameterResolverAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 the original author or authors. + * Copyright 2017-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,12 +14,13 @@ * limitations under the License. */ -package org.springframework.shell.jcommander; +package org.springframework.shell.boot; import com.beust.jcommander.JCommander; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.context.annotation.Configuration; +import org.springframework.shell.jcommander.JCommanderParameterResolver; import org.springframework.context.annotation.Bean; /** @@ -28,7 +29,7 @@ import org.springframework.context.annotation.Bean; * @author Eric Bottard */ @Configuration -@ConditionalOnClass(JCommander.class) +@ConditionalOnClass({ JCommander.class, JCommanderParameterResolver.class }) public class JCommanderParameterResolverAutoConfiguration { @Bean diff --git a/spring-shell-core/src/main/java/org/springframework/shell/JLineAutoConfiguration.java b/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/JLineAutoConfiguration.java similarity index 96% rename from spring-shell-core/src/main/java/org/springframework/shell/JLineAutoConfiguration.java rename to spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/JLineAutoConfiguration.java index bb74f0ba..a0a560ea 100644 --- a/spring-shell-core/src/main/java/org/springframework/shell/JLineAutoConfiguration.java +++ b/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/JLineAutoConfiguration.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.shell; +package org.springframework.shell.boot; import org.jline.reader.impl.history.DefaultHistory; diff --git a/spring-shell-core/src/main/java/org/springframework/shell/jline/JLineShellAutoConfiguration.java b/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/JLineShellAutoConfiguration.java similarity index 73% rename from spring-shell-core/src/main/java/org/springframework/shell/jline/JLineShellAutoConfiguration.java rename to spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/JLineShellAutoConfiguration.java index 6d123821..1fdcfbdb 100644 --- a/spring-shell-core/src/main/java/org/springframework/shell/jline/JLineShellAutoConfiguration.java +++ b/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/JLineShellAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 the original author or authors. + * Copyright 2017-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,11 +14,9 @@ * limitations under the License. */ -package org.springframework.shell.jline; +package org.springframework.shell.boot; import java.io.IOException; -import java.util.List; -import java.util.stream.Collectors; import org.jline.reader.Parser; import org.jline.terminal.Terminal; @@ -30,6 +28,8 @@ import org.springframework.beans.factory.BeanCreationException; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.shell.jline.ExtendedDefaultParser; +import org.springframework.shell.jline.PromptProvider; /** * Shell implementation using JLine to capture input and trigger completions. @@ -63,16 +63,4 @@ public class JLineShellAutoConfiguration { parser.setEofOnEscapedNewLine(true); return parser; } - - /** - * Sanitize the buffer input given the customizations applied to the JLine parser (e.g. support for - * line continuations, etc.) - */ - static List sanitizeInput(List words) { - words = words.stream() - .map(s -> s.replaceAll("^\\n+|\\n+$", "")) // CR at beginning/end of line introduced by backslash continuation - .map(s -> s.replaceAll("\\n+", " ")) // CR in middle of word introduced by return inside a quoted string - .collect(Collectors.toList()); - return words; - } } diff --git a/spring-shell-core/src/main/java/org/springframework/shell/LineReaderAutoConfiguration.java b/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/LineReaderAutoConfiguration.java similarity index 97% rename from spring-shell-core/src/main/java/org/springframework/shell/LineReaderAutoConfiguration.java rename to spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/LineReaderAutoConfiguration.java index 6a6aec41..c2f8ea8c 100644 --- a/spring-shell-core/src/main/java/org/springframework/shell/LineReaderAutoConfiguration.java +++ b/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/LineReaderAutoConfiguration.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.shell; +package org.springframework.shell.boot; import java.io.IOException; import java.nio.file.Paths; @@ -35,6 +35,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.event.ContextClosedEvent; import org.springframework.context.event.EventListener; +import org.springframework.shell.CommandRegistry; @Configuration public class LineReaderAutoConfiguration { diff --git a/spring-shell-core/src/main/java/org/springframework/shell/SpringShellAutoConfiguration.java b/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/SpringShellAutoConfiguration.java similarity index 94% rename from spring-shell-core/src/main/java/org/springframework/shell/SpringShellAutoConfiguration.java rename to spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/SpringShellAutoConfiguration.java index 70726f07..711638f1 100644 --- a/spring-shell-core/src/main/java/org/springframework/shell/SpringShellAutoConfiguration.java +++ b/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/SpringShellAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 the original author or authors. + * Copyright 2017-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.shell; +package org.springframework.shell.boot; import java.util.Collection; @@ -32,6 +32,8 @@ import org.springframework.core.convert.converter.Converter; import org.springframework.core.convert.converter.ConverterFactory; import org.springframework.core.convert.converter.GenericConverter; import org.springframework.core.convert.support.DefaultConversionService; +import org.springframework.shell.ResultHandler; +import org.springframework.shell.Shell; import org.springframework.shell.result.IterableResultHandler; import org.springframework.shell.result.ResultHandlerConfig; diff --git a/spring-shell-standard-commands/src/main/java/org/springframework/shell/standard/commands/StandardCommandsAutoConfiguration.java b/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/StandardCommandsAutoConfiguration.java similarity index 83% rename from spring-shell-standard-commands/src/main/java/org/springframework/shell/standard/commands/StandardCommandsAutoConfiguration.java rename to spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/StandardCommandsAutoConfiguration.java index 1d2e262b..fcd792bf 100644 --- a/spring-shell-standard-commands/src/main/java/org/springframework/shell/standard/commands/StandardCommandsAutoConfiguration.java +++ b/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/StandardCommandsAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 the original author or authors. + * Copyright 2017-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,19 +14,26 @@ * limitations under the License. */ -package org.springframework.shell.standard.commands; +package org.springframework.shell.boot; import java.util.List; import org.jline.reader.Parser; import org.springframework.beans.factory.ObjectProvider; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.shell.ParameterResolver; import org.springframework.shell.Shell; +import org.springframework.shell.standard.commands.Clear; +import org.springframework.shell.standard.commands.Help; +import org.springframework.shell.standard.commands.History; +import org.springframework.shell.standard.commands.Quit; +import org.springframework.shell.standard.commands.Script; +import org.springframework.shell.standard.commands.Stacktrace; /** * Creates beans for standard commands. @@ -34,6 +41,7 @@ import org.springframework.shell.Shell; * @author Eric Bottard */ @Configuration +@ConditionalOnClass({ Help.Command.class }) public class StandardCommandsAutoConfiguration { @Bean diff --git a/spring-shell-autoconfigure/src/main/resources/META-INF/spring.factories b/spring-shell-autoconfigure/src/main/resources/META-INF/spring.factories new file mode 100644 index 00000000..ce2992e4 --- /dev/null +++ b/spring-shell-autoconfigure/src/main/resources/META-INF/spring.factories @@ -0,0 +1,10 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +org.springframework.shell.boot.SpringShellAutoConfiguration,\ +org.springframework.shell.boot.ApplicationRunnerAutoConfiguration,\ +org.springframework.shell.boot.CommandRegistryAutoConfiguration,\ +org.springframework.shell.boot.LineReaderAutoConfiguration,\ +org.springframework.shell.boot.CompleterAutoConfiguration,\ +org.springframework.shell.boot.JLineAutoConfiguration,\ +org.springframework.shell.boot.JLineShellAutoConfiguration,\ +org.springframework.shell.boot.JCommanderParameterResolverAutoConfiguration,\ +org.springframework.shell.boot.StandardCommandsAutoConfiguration diff --git a/spring-shell-core/src/main/java/org/springframework/shell/Utils.java b/spring-shell-core/src/main/java/org/springframework/shell/Utils.java index 338ffc8f..0d1634e9 100644 --- a/spring-shell-core/src/main/java/org/springframework/shell/Utils.java +++ b/spring-shell-core/src/main/java/org/springframework/shell/Utils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,8 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Executable; import java.lang.reflect.Method; import java.lang.reflect.Parameter; +import java.util.List; +import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; @@ -86,4 +88,16 @@ public class Utils { .mapToObj(i -> createMethodParameter(executable, i)); } + /** + * Sanitize the buffer input given the customizations applied to the JLine + * parser (e.g. support for + * line continuations, etc.) + */ + public static List sanitizeInput(List words) { + words = words.stream() + .map(s -> s.replaceAll("^\\n+|\\n+$", "")) // CR at beginning/end of line introduced by backslash continuation + .map(s -> s.replaceAll("\\n+", " ")) // CR in middle of word introduced by return inside a quoted string + .collect(Collectors.toList()); + return words; + } } diff --git a/spring-shell-core/src/main/java/org/springframework/shell/jline/ExtendedDefaultParser.java b/spring-shell-core/src/main/java/org/springframework/shell/jline/ExtendedDefaultParser.java index 8788ca36..fd71edba 100644 --- a/spring-shell-core/src/main/java/org/springframework/shell/jline/ExtendedDefaultParser.java +++ b/spring-shell-core/src/main/java/org/springframework/shell/jline/ExtendedDefaultParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 the original author or authors. + * Copyright 2017-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ import org.springframework.shell.CompletingParsedLine; * @author Original JLine author * @author Eric Bottard */ -class ExtendedDefaultParser implements Parser { +public class ExtendedDefaultParser implements Parser { private char[] quoteChars = { '\'', '"' }; diff --git a/spring-shell-core/src/main/java/org/springframework/shell/jline/ParsedLineInput.java b/spring-shell-core/src/main/java/org/springframework/shell/jline/ParsedLineInput.java index 44b62ac0..82c6eae2 100644 --- a/spring-shell-core/src/main/java/org/springframework/shell/jline/ParsedLineInput.java +++ b/spring-shell-core/src/main/java/org/springframework/shell/jline/ParsedLineInput.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 the original author or authors. + * Copyright 2017-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,13 @@ package org.springframework.shell.jline; -import org.jline.reader.ParsedLine; -import org.springframework.shell.Input; - import java.util.List; +import org.jline.reader.ParsedLine; + +import org.springframework.shell.Input; +import org.springframework.shell.Utils; + /** * An implementation of {@link Input} backed by the result of a {@link org.jline.reader.Parser#parse(String, int)}. * @@ -41,6 +43,6 @@ class ParsedLineInput implements Input { @Override public List words() { - return JLineShellAutoConfiguration.sanitizeInput(parsedLine.words()); + return Utils.sanitizeInput(parsedLine.words()); } } diff --git a/spring-shell-core/src/main/resources/META-INF/spring.factories b/spring-shell-core/src/main/resources/META-INF/spring.factories index 15d3e03e..e69de29b 100644 --- a/spring-shell-core/src/main/resources/META-INF/spring.factories +++ b/spring-shell-core/src/main/resources/META-INF/spring.factories @@ -1,8 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ -org.springframework.shell.SpringShellAutoConfiguration,\ -org.springframework.shell.ApplicationRunnerAutoConfiguration,\ -org.springframework.shell.CommandRegistryAutoConfiguration,\ -org.springframework.shell.LineReaderAutoConfiguration,\ -org.springframework.shell.CompleterAutoConfiguration,\ -org.springframework.shell.JLineAutoConfiguration,\ -org.springframework.shell.jline.JLineShellAutoConfiguration diff --git a/spring-shell-docs/pom.xml b/spring-shell-docs/pom.xml index a9ee1b22..a836945f 100644 --- a/spring-shell-docs/pom.xml +++ b/spring-shell-docs/pom.xml @@ -4,7 +4,7 @@ spring-shell-docs Spring Shell Documentation - jar + pom org.springframework.shell diff --git a/spring-shell-jcommander-adapter/src/main/resources/META-INF/spring.factories b/spring-shell-jcommander-adapter/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 5f1a4cad..00000000 --- a/spring-shell-jcommander-adapter/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ -org.springframework.shell.jcommander.JCommanderParameterResolverAutoConfiguration diff --git a/spring-shell-samples/src/main/java/org/springframework/shell/samples/noautoconf/NoAutoConf.java b/spring-shell-samples/src/main/java/org/springframework/shell/samples/noautoconf/NoAutoConf.java index 0d3cc367..2198371f 100644 --- a/spring-shell-samples/src/main/java/org/springframework/shell/samples/noautoconf/NoAutoConf.java +++ b/spring-shell-samples/src/main/java/org/springframework/shell/samples/noautoconf/NoAutoConf.java @@ -19,16 +19,16 @@ package org.springframework.shell.samples.noautoconf; import org.springframework.boot.SpringApplication; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; -import org.springframework.shell.SpringShellAutoConfiguration; -import org.springframework.shell.jcommander.JCommanderParameterResolverAutoConfiguration; -import org.springframework.shell.jline.JLineShellAutoConfiguration; +import org.springframework.shell.boot.JCommanderParameterResolverAutoConfiguration; +import org.springframework.shell.boot.JLineShellAutoConfiguration; +import org.springframework.shell.boot.SpringShellAutoConfiguration; +import org.springframework.shell.boot.StandardCommandsAutoConfiguration; import org.springframework.shell.samples.jcommander.JCommanderCommands; import org.springframework.shell.samples.standard.Commands; import org.springframework.shell.samples.standard.DynamicCommands; import org.springframework.shell.samples.standard.TableCommands; import org.springframework.shell.standard.FileValueProvider; import org.springframework.shell.standard.StandardAPIAutoConfiguration; -import org.springframework.shell.standard.commands.StandardCommandsAutoConfiguration; /** * This class shows how to use the full extent of Spring Shell without relying on Boot auto configuration. diff --git a/spring-shell-standard-commands/src/main/resources/META-INF/spring.factories b/spring-shell-standard-commands/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 786cb611..00000000 --- a/spring-shell-standard-commands/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ -org.springframework.shell.standard.commands.StandardCommandsAutoConfiguration diff --git a/spring-shell-starter/pom.xml b/spring-shell-starter/pom.xml index bc4de285..4898d113 100644 --- a/spring-shell-starter/pom.xml +++ b/spring-shell-starter/pom.xml @@ -4,17 +4,21 @@ spring-shell-starter Spring Shell Starter - jar + pom org.springframework.shell spring-shell-parent 3.0.0-SNAPSHOT - + Starter Dependency for Using Spring Shell + + org.springframework.shell + spring-shell-autoconfigure + org.springframework.shell spring-shell-core @@ -36,5 +40,5 @@ spring-shell-table - +