An open API service indexing awesome lists of open source software.

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

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/