File tree Expand file tree Collapse file tree 4 files changed +60
-0
lines changed
spring-shell-sample-hello-world
java/org/springframework/shell/samples/helloworld Expand file tree Collapse file tree 4 files changed +60
-0
lines changed Original file line number Diff line number Diff line change 1414 <description >Samples applications of how to use Spring Shell</description >
1515
1616 <modules >
17+ <module >spring-shell-sample-hello-world</module >
1718 <module >spring-shell-sample-catalog</module >
1819 <module >spring-shell-sample-commands</module >
1920 <module >spring-shell-sample-e2e</module >
Original file line number Diff line number Diff line change 1+ <project xmlns =" http://maven.apache.org/POM/4.0.0" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
2+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" >
3+ <modelVersion >4.0.0</modelVersion >
4+
5+ <parent >
6+ <groupId >org.springframework.shell</groupId >
7+ <artifactId >spring-shell-samples</artifactId >
8+ <version >4.0.0-SNAPSHOT</version >
9+ </parent >
10+
11+ <artifactId >spring-shell-sample-hello-world</artifactId >
12+ <name >Spring Shell Samples - Hello World</name >
13+ <packaging >jar</packaging >
14+ <description >Hello World Spring Shell application</description >
15+
16+ <dependencies >
17+ <dependency >
18+ <groupId >org.springframework.shell</groupId >
19+ <artifactId >spring-shell-starter</artifactId >
20+ <version >${project.parent.version} </version >
21+ </dependency >
22+
23+ <dependency >
24+ <groupId >org.hibernate.validator</groupId >
25+ <artifactId >hibernate-validator</artifactId >
26+ <version >${hibernate-validator.version} </version >
27+ </dependency >
28+ <dependency >
29+ <groupId >org.glassfish</groupId >
30+ <artifactId >jakarta.el</artifactId >
31+ <version >${jakarta.el.version} </version >
32+ </dependency >
33+ </dependencies >
34+
35+ </project >
Original file line number Diff line number Diff line change 1+ package org .springframework .shell .samples .helloworld ;
2+
3+ import org .springframework .boot .SpringApplication ;
4+ import org .springframework .boot .autoconfigure .SpringBootApplication ;
5+ import org .springframework .shell .core .command .annotation .Command ;
6+ import org .springframework .shell .core .command .annotation .EnableCommand ;
7+ import org .springframework .shell .core .command .annotation .Option ;
8+
9+ @ SpringBootApplication
10+ @ EnableCommand (SpringShellApplication .class )
11+ @ Command
12+ public class SpringShellApplication {
13+
14+ public static void main (String [] args ) {
15+ SpringApplication .run (SpringShellApplication .class , args );
16+ }
17+
18+ @ Command
19+ public String hello (@ Option (defaultValue = "World" ) String name ) {
20+ return "Hello " + name + "!" ;
21+ }
22+
23+ }
Original file line number Diff line number Diff line change 1+ spring.shell.interactive.enabled =true
You can’t perform that action at this time.
0 commit comments