https://github.com/linux-china/spring-boot-starter-shell
Spring Shell with Spring Boot Driven
https://github.com/linux-china/spring-boot-starter-shell
spring-boot spring-shell
Last synced: 11 months ago
JSON representation
Spring Shell with Spring Boot Driven
- Host: GitHub
- URL: https://github.com/linux-china/spring-boot-starter-shell
- Owner: linux-china
- Created: 2016-05-09T13:35:11.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-09-13T08:51:43.000Z (over 8 years ago)
- Last Synced: 2025-04-02T02:51:14.433Z (11 months ago)
- Topics: spring-boot, spring-shell
- Language: Java
- Size: 9.77 KB
- Stars: 17
- Watchers: 4
- Forks: 9
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
spring-boot-start-shell
=======================
Spring Shell with Spring Boot Driven
### How to use
* Add spring-boot-starter-shell dependency in application's pom.xml:
```xml
org.mvnsearch.spring.boot
spring-boot-starter-shell
1.0.0-SNAPSHOT
```
* Add Spring Boot Maven Plugin in your pom.xml:
```xml
org.springframework.boot
spring-boot-maven-plugin
1.4.0.RELEASE
repackage
false
```
* Add following code in your Spring Boot Application main method:
```
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringShellApplication.run(DemoApplication.class, args);
}
}
```
* Of course, create your Spring Shell commands.
```
@Component
public class HelloCommands implements CommandMarker {
@CliCommand(value = "hello", help = "CMS ")
public String hello() {
return "hello";
}
}
```
* Build your application and run it.
```
$ mvn -DskipTests clean package
$ java -jar target/xxxx.jar
```
### Tips
* Possible Configuration in your application.properties:
```properties
spring.main.banner-mode=off
```
* logback-spring.xml configuration to mute some log:
```xml
%d %-5level %logger{36} - %msg%n
```
### Todo
Migrate to: https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-shell-core/src/main/java/org/springframework/cloud/dataflow/shell/autoconfigure/BaseShellAutoConfiguration.java
### References
* Spring Shell Document: http://docs.spring.io/spring-shell/docs/current/reference/htmlsingle/
* ASCII Generator: http://www.network-science.de/ascii/