-
Notifications
You must be signed in to change notification settings - Fork 92
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
"Generate from Maven Archetype" to propose archetype version, by semantic-version ordering #354
Comments
We assumed that, by not specifying the version it would pick the latest version of the archetype, and most people would prefer the latest one. But now it seems we were wrong...
It makes sense and it's feasible.
Exactly. That's why we update and prepack it as a compressed .json file, much more smaller in size. Please share if you have any other suggestion for fetching the metadata. BTW, besides listing the archetype versions, I was thinking also to prompt input boxes for groupId and artifactId, and turn off interactiveMode. The advantage would be:
@tarilabs Any thoughts on this? |
Thanks for the prompt reply @Eskibear !
Awesome!
Not particularly, I guess it's acceptable for the remote catalog refresh to take the needed (network) time
This could be an issue for some archetypes. What about having this as a default, but support the "input archetype parameters via interactiveMode" as a configuration option in this extensions? Alternatively, but this would require more efforts, the extension could inspect the archetype for the archetype parameters and prompt for them, in order to later supply them via command line, I believe this is feasible as other IDEs like Eclipse IDE have the user supply archetype parameters, the one specifically related to the selected archetype, in a special dialog window --they are also pre-populated with the correct archetype parameter values by default In any case, thank you! |
I'll add archetype version support in the coming version. |
Suggestion
In the "remote archetype catalog" from Maven central[1] the archetypes are not ordered by semantic version scheme, just by lexicographic ordering of the artifcat version.
The mvn command used by this extension[2] if not supplied with an archetype version will pick the first one from the catalog xml, which is not necessarily the most up-to-date.
Please consider for the VSCode extension to propose the user, after having selected a specific archetype, to confirm which version to use (if more than 1 version in catalog) and list the versions by semantic-version order. Finally, passing down
archetypeVersion
to the mvn command used in turn.[1] warning, big xml file ! https://repo1.maven.org/maven2/archetype-catalog.xml
[2]
mvn archetype:generate -DarchetypeArtifactId="myArtifactId" -DarchetypeGroupId="myGroupId"
Use Cases
When an archetype is released to maven central in multiple version, and as commonly used semantic-version is used for naming a version. E.g.: by remote archetype catalog a version like 7.9 is always first in the file if compared to version 7.23
Examples
In the VSCode extension, after having selected a given artifact, do list all the available versions for that artifact and ordered by semantic-version order, not lexicographic order.
Pass down the selection to the mvn command used by this extension.
E.g.: from today like
to
Thanks in advance for considering this
The text was updated successfully, but these errors were encountered: