欢迎访问『www.cnblogs.com/blog-ice』

1.怎加依赖
2.添加注解


<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.8.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <dependency> <groupId>org.springframework.shell</groupId> <artifactId>spring-shell-starter</artifactId> <version>2.0.1.RELEASE</version> </dependency> @ShellComponent public class MyCommands { @ShellMethod("Add two integers together.") public int add(int a, int b) { return a + b; } @ShellMethod("echo") public String echo(String msg) { return msg; } }

 

posted on 2022-01-28 12:27  仙路尽头谁为峰  阅读(172)  评论(0编辑  收藏  举报
这里是自由发挥的天堂