Get ahead
VMware offers training and certification to turbo-charge your progress.
Learn moreWe are pleased to announce the first release milestone of Spring Shell 2.x!
Two years in the making, Spring Shell 2 is a complete rewrite of Spring Shell, leveraging newer components (such as JLine 3) and applying better modularization. Spring Shell 2 is also built with Spring Boot in mind, making use of auto configuration and other boot features.
The internal architecture now uses a pluggable model to discover what methods to turn into commands, how to parse user input into argument values and how to handle return values. This is very similar to the approach taken by Spring MVC for example and allows extensions of the framework in ways that were not previously possible. Users of Spring Shell would typically not care though, only dealing with the new "standard" command API to define their commands.
Some of the new features are highlighted in the video below (be sure to run it full screen), but here is a more extensive rundown:
help
command is way more useful than it used to be, resembling the output of a man
pageThe short video below shows some of the features, using example commands that have the following signatures:
@ShellMethod("Add an item to the current order.")
public String addItem(
@ShellOption(help = "the item reference") String item,
@ShellOption(help = "unit price") @Min(0) float price,
@ShellOption(help = "the number of items to add", defaultValue = "1") @Range(min = 1, max = 15) int qty
) { ... }
@ShellMethod("Submit the order for processing.")
public List<?> submitOrder() { ... }
This is just the first milestone, full of new features. In the upcoming weeks, we plan on fixing a few bugs, finishing writing the comprehensive reference documentation and refactor a few internals, leading to a 2.0.0.RELEASE for Spring One Platform.
In the meantime, please try it out and provide feedback!
I'd like to thank Florent Biville and Camilo Gonzalez who helped make this rewrite concrete by providing useful ideas and some of their valuable time!