Merge pull request #40603 from coursar

* pr/40603:
  Polish "Change Spring Boot CLI init command docs default build system to gradle"
  Change Spring Boot CLI init command docs default build system to gradle

Closes gh-40603
This commit is contained in:
Moritz Halbritter 2024-05-02 10:50:33 +02:00
commit d19df3d651
2 changed files with 3 additions and 3 deletions

View File

@ -165,7 +165,7 @@ public class InitCommand extends OptionParsingCommand {
this.packaging = option(Arrays.asList("packaging", "p"), "Project packaging (for example 'jar')") 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() this.build = option("build", "Build system to use (for example 'maven' or 'gradle')").withRequiredArg()
.defaultsTo("maven"); .defaultsTo("gradle");
this.format = option("format", "Format of the generated content (for example 'build' for a build file, " this.format = option("format", "Format of the generated content (for example 'build' for a build file, "
+ "'project' for a project archive)") + "'project' for a project archive)")
.withRequiredArg() .withRequiredArg()

View File

@ -344,7 +344,7 @@ class InitCommandTests extends AbstractHttpClientMockTests {
void parseTypeOnly() throws Exception { void parseTypeOnly() throws Exception {
this.handler.disableProjectGeneration(); this.handler.disableProjectGeneration();
this.command.run("-t=ant-project"); this.command.run("-t=ant-project");
assertThat(this.handler.lastRequest.getBuild()).isEqualTo("maven"); assertThat(this.handler.lastRequest.getBuild()).isEqualTo("gradle");
assertThat(this.handler.lastRequest.getFormat()).isEqualTo("project"); assertThat(this.handler.lastRequest.getFormat()).isEqualTo("project");
assertThat(this.handler.lastRequest.isDetectType()).isFalse(); assertThat(this.handler.lastRequest.isDetectType()).isFalse();
assertThat(this.handler.lastRequest.getType()).isEqualTo("ant-project"); assertThat(this.handler.lastRequest.getType()).isEqualTo("ant-project");
@ -364,7 +364,7 @@ class InitCommandTests extends AbstractHttpClientMockTests {
void parseFormatOnly() throws Exception { void parseFormatOnly() throws Exception {
this.handler.disableProjectGeneration(); this.handler.disableProjectGeneration();
this.command.run("--format=web"); this.command.run("--format=web");
assertThat(this.handler.lastRequest.getBuild()).isEqualTo("maven"); assertThat(this.handler.lastRequest.getBuild()).isEqualTo("gradle");
assertThat(this.handler.lastRequest.getFormat()).isEqualTo("web"); assertThat(this.handler.lastRequest.getFormat()).isEqualTo("web");
assertThat(this.handler.lastRequest.isDetectType()).isTrue(); assertThat(this.handler.lastRequest.isDetectType()).isTrue();
assertThat(this.handler.lastRequest.getType()).isNull(); assertThat(this.handler.lastRequest.getType()).isNull();