New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support both kebab-case and camelCase as Spring init CLI Options #28138
Changes from all commits
b35508d
de0f46d
11bb419
fa94c43
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ | |
* | ||
* @author Stephane Nicoll | ||
* @author Eddú Meléndez | ||
* @author Vignesh Thangavel Ilangovan | ||
* @since 1.2.0 | ||
*/ | ||
public class InitCommand extends OptionParsingCommand { | ||
|
@@ -128,16 +129,20 @@ protected void options() { | |
otherOptions(); | ||
} | ||
|
||
/** | ||
* Supports both kebab-case and camelCase as project CLI Options. camelCase to be | ||
* deprecated as part of future releases | ||
*/ | ||
private void projectGenerationOptions() { | ||
this.groupId = option(Arrays.asList("groupId", "g"), "Project coordinates (for example 'org.test')") | ||
.withRequiredArg(); | ||
this.artifactId = option(Arrays.asList("artifactId", "a"), | ||
this.groupId = option(Arrays.asList("groupId", "group-id", "g"), | ||
"Project coordinates (for example 'org.test')").withRequiredArg(); | ||
this.artifactId = option(Arrays.asList("artifactId", "artifact-id", "a"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
"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(); | ||
this.name = option(Arrays.asList("name", "n"), "Project name; infer application name").withRequiredArg(); | ||
this.description = option("description", "Project description").withRequiredArg(); | ||
this.packageName = option("package-name", "Package name").withRequiredArg(); | ||
this.packageName = option(Arrays.asList("packageName", "package-name"), "Package name").withRequiredArg(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The plan is to use kebab case consistently, not introducing a mixed case for new properties. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought we were going to support both camelCase and kebab-case until we've improved the output of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah ok, right. I understand now. Yes, so we should have to consistent indeed but we need to deprecate them. |
||
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") | ||
|
@@ -148,11 +153,11 @@ private void projectGenerationOptions() { | |
.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"); | ||
this.javaVersion = option(Arrays.asList("java-version", "j"), "Language level (for example '1.8')") | ||
.withRequiredArg(); | ||
this.javaVersion = option(Arrays.asList("javaVersion", "java-version", "j"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The plan is to use kebab case consistently, not introducing a mixed case for new properties. |
||
"Language level (for example '1.8')").withRequiredArg(); | ||
this.language = option(Arrays.asList("language", "l"), "Programming language (for example 'java')") | ||
.withRequiredArg(); | ||
this.bootVersion = option(Arrays.asList("boot-version", "b"), | ||
this.bootVersion = option(Arrays.asList("bootVersion", "boot-version", "b"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The plan is to use kebab case consistently, not introducing a mixed case for new properties. |
||
"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") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
groupId
is not deprecated.