Spring Boot - CLI

You can use Spring Boot CLI to generate Spring Boot application

Installation

You can download CLI from spring boot cli

After you download the zip file. unzip it to a place you like. You need to add the binary file path to the PATH environment variable.

Initialize a new Project

To display help

1
spring --help

To list the capabilities of the service. Use it to discover the dependencies and the types that are available

1
spring init --list

To create a default project. This will generate demo.zip file

1
spring init

To create a project ‘myapp’ with web, devtools, lombok, jpa,h2 dependency and with artifactId myapp. Unpacked.

1
spring init -j=17 -t=maven-project -d=web,devtools,lombok myapp

Also create a maven project. This time with group id, name, artifiactId and java version

1
2
spring init -j=17 -t=maven-project -d=web,devtools,lombok,jpa,h2 \
-g=com.xinghua24 -n=myapp -a=myapp myapp
1
2
spring init -j=17 -t=maven-project -d=web,devtools,lombok,jpa,mysql \
-g=com.xinghua24 -n=myapp -a=myapp myapp