Merge branch '2.7.x' into 3.0.x
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2023 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.
|
||||
@@ -40,7 +40,7 @@ import org.springframework.util.StringUtils;
|
||||
public class CommandRunner implements Iterable<Command> {
|
||||
|
||||
private static final Set<CommandException.Option> NO_EXCEPTION_OPTIONS = EnumSet
|
||||
.noneOf(CommandException.Option.class);
|
||||
.noneOf(CommandException.Option.class);
|
||||
|
||||
private final String name;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2023 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.
|
||||
@@ -70,8 +70,8 @@ public class EncodePasswordCommand extends OptionParsingCommand {
|
||||
@Override
|
||||
public Collection<HelpExample> getExamples() {
|
||||
List<HelpExample> examples = new ArrayList<>();
|
||||
examples.add(
|
||||
new HelpExample("To encode a password with the default encoder", "spring encodepassword mypassword"));
|
||||
examples
|
||||
.add(new HelpExample("To encode a password with the default encoder", "spring encodepassword mypassword"));
|
||||
examples.add(new HelpExample("To encode a password with pbkdf2", "spring encodepassword -a pbkdf2 mypassword"));
|
||||
return examples;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ public class EncodePasswordCommand extends OptionParsingCommand {
|
||||
@Override
|
||||
protected void options() {
|
||||
this.algorithm = option(Arrays.asList("algorithm", "a"), "The algorithm to use").withRequiredArg()
|
||||
.defaultsTo("default");
|
||||
.defaultsTo("default");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2023 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.
|
||||
@@ -139,7 +139,7 @@ public class InitCommand extends OptionParsingCommand {
|
||||
@Override
|
||||
protected void options() {
|
||||
this.target = option(Arrays.asList("target"), "URL of the service to use").withRequiredArg()
|
||||
.defaultsTo(ProjectGenerationRequest.DEFAULT_SERVICE_URL);
|
||||
.defaultsTo(ProjectGenerationRequest.DEFAULT_SERVICE_URL);
|
||||
this.listCapabilities = option(Arrays.asList("list"),
|
||||
"List the capabilities of the service. Use it to discover the "
|
||||
+ "dependencies and the types that are available");
|
||||
@@ -149,33 +149,37 @@ public class InitCommand extends OptionParsingCommand {
|
||||
|
||||
private void projectGenerationOptions() {
|
||||
this.groupId = option(Arrays.asList("group-id", "g"), "Project coordinates (for example 'org.test')")
|
||||
.withRequiredArg();
|
||||
.withRequiredArg();
|
||||
this.artifactId = option(Arrays.asList("artifact-id", "a"),
|
||||
"Project coordinates; infer archive name (for example 'test')").withRequiredArg();
|
||||
"Project coordinates; infer archive name (for example 'test')")
|
||||
.withRequiredArg();
|
||||
this.version = option(Arrays.asList("version", "v"), "Project version (for example '0.0.1-SNAPSHOT')")
|
||||
.withRequiredArg();
|
||||
.withRequiredArg();
|
||||
this.name = option(Arrays.asList("name", "n"), "Project name; infer application name").withRequiredArg();
|
||||
this.description = option("description", "Project description").withRequiredArg();
|
||||
this.packageName = option(Arrays.asList("package-name"), "Package name").withRequiredArg();
|
||||
this.type = option(Arrays.asList("type", "t"),
|
||||
"Project type. Not normally needed if you use --build "
|
||||
+ "and/or --format. Check the capabilities of the service (--list) for more details")
|
||||
.withRequiredArg();
|
||||
.withRequiredArg();
|
||||
this.packaging = option(Arrays.asList("packaging", "p"), "Project packaging (for example 'jar')")
|
||||
.withRequiredArg();
|
||||
.withRequiredArg();
|
||||
this.build = option("build", "Build system to use (for example 'maven' or 'gradle')").withRequiredArg()
|
||||
.defaultsTo("maven");
|
||||
.defaultsTo("maven");
|
||||
this.format = option("format", "Format of the generated content (for example 'build' for a build file, "
|
||||
+ "'project' for a project archive)").withRequiredArg().defaultsTo("project");
|
||||
+ "'project' for a project archive)")
|
||||
.withRequiredArg()
|
||||
.defaultsTo("project");
|
||||
this.javaVersion = option(Arrays.asList("java-version", "j"), "Language level (for example '1.8')")
|
||||
.withRequiredArg();
|
||||
.withRequiredArg();
|
||||
this.language = option(Arrays.asList("language", "l"), "Programming language (for example 'java')")
|
||||
.withRequiredArg();
|
||||
.withRequiredArg();
|
||||
this.bootVersion = option(Arrays.asList("boot-version", "b"),
|
||||
"Spring Boot version (for example '1.2.0.RELEASE')").withRequiredArg();
|
||||
"Spring Boot version (for example '1.2.0.RELEASE')")
|
||||
.withRequiredArg();
|
||||
this.dependencies = option(Arrays.asList("dependencies", "d"),
|
||||
"Comma-separated list of dependency identifiers to include in the generated project")
|
||||
.withRequiredArg();
|
||||
.withRequiredArg();
|
||||
}
|
||||
|
||||
private void otherOptions() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2023 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.
|
||||
@@ -152,7 +152,7 @@ public class OptionHandler {
|
||||
@Override
|
||||
public String format(Map<String, ? extends OptionDescriptor> options) {
|
||||
Comparator<OptionDescriptor> comparator = Comparator
|
||||
.comparing((optionDescriptor) -> optionDescriptor.options().iterator().next());
|
||||
.comparing((optionDescriptor) -> optionDescriptor.options().iterator().next());
|
||||
Set<OptionDescriptor> sorted = new TreeSet<>(comparator);
|
||||
sorted.addAll(options.values());
|
||||
for (OptionDescriptor descriptor : sorted) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2023 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.
|
||||
@@ -114,7 +114,7 @@ public class Shell {
|
||||
this.consoleReader.setBellEnabled(false);
|
||||
this.consoleReader.setExpandEvents(false);
|
||||
this.consoleReader
|
||||
.addCompleter(new CommandCompleter(this.consoleReader, this.argumentDelimiter, this.commandRunner));
|
||||
.addCompleter(new CommandCompleter(this.consoleReader, this.argumentDelimiter, this.commandRunner));
|
||||
this.consoleReader.setCompletionHandler(new CandidateListCompletionHandler());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user