-
Notifications
You must be signed in to change notification settings - Fork 34
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
Specify Java version; Load default Java version; #146
Conversation
Thanks for the contribution.
BTW we're switching to consume the latest (v2.2) metadata. Ideally we don't have to have the settings to hardcode the options, as they can be retrieved by querying the service. |
Thanks for reviewing!
I see that to decrease the steps, the user should set default values. The user change the pom.xml is always a choice, but I also see that this extension should replace the need for it (and even the access the start.spring.io)
Fine! I will commit that later!
I have a comment about setting the "Name": in the current version, changing the ArtifactId change the pom.xml file, but it doesn't affect the Application Name, that is, the "main" class will have the default name "DemoApplication" (and also the filename DemoApplication.java).
Nice! |
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.
Overall it's ok. For the "name" issue, let's simply reuse the value of artifact id.
package.json
Outdated
@@ -108,6 +120,12 @@ | |||
"scope": "window", | |||
"description": "Default value for Artifact Id." | |||
}, | |||
"spring.initializr.defaultName": { |
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.
we don't have to have this setting
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.
Done.
README.md
Outdated
// Default value for Artifact Id. | ||
"spring.initializr.defaultArtifactId": "demo", | ||
|
||
// Default value for Name. |
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.
we don't need it
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.
Done.
TestPlan.md
Outdated
@@ -64,6 +64,13 @@ After that, verify `build.gradle` instead of `pom.xml`. | |||
1. Verify: | |||
1. `GroupId` and `ArtifactId` are filled by the specified default values. | |||
|
|||
### Default value of Name. |
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.
remove this section
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.
Done.
src/Utils/index.ts
Outdated
@@ -114,6 +114,10 @@ export function artifactIdValidation(value: string): string { | |||
return (/^[a-z_][a-z0-9_]*(-[a-z_][a-z0-9_]*)*$/.test(value)) ? null : "Invalid Artifact Id"; | |||
} | |||
|
|||
export function nameValidation(value: string): string { |
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.
remove this
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.
Done.
placeHolder: "e.g. demo (will turn into DemoApplication class - mostly the same as ArtifactId)", | ||
prompt: "Input project name.", | ||
validateInput: nameValidation, | ||
value: defaultName, |
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.
As you mentioned:
mostly the same as ArtifactId
Let's remove this step, just re-use the value of artifactId.
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.
Done.
`groupId=${this.groupId}`, | ||
`artifactId=${this.artifactId}`, | ||
`name=${this.name}`, |
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.
name=${this.artifactId}
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.
Done.
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.
Thanks!
Pulling a "Specify Java version" feature.
It is simple to change the Java version when the project is created (issue 136 is closed with that comment - #136 ), but I added this feature since VSCode is turning to use Java 11, so it is helpful to choose Java version when creating the project.