Once you’ve installed the CLI tools, you should be able to check the version of Spring you have:

$ spring --version

Spring CLI v2.1.1.RELEASE

If you can see a version for your installation of the CLI, congrats! Now navigate to the directory where you want to host your examples from the report and run the following command:

$ spring init --build maven --groupId com.redhat.examples \ --version 1.0 --java-version 1.8 --dependencies web \ --name hello-springboot hello-springboot

After running this command, you should have a directory named hello-springboot with a complete Spring Boot application. If you run the command and end up with a demo.zip, then just unzip it and continue. Let’s take a quick look at what those command-line options are:

--build

The build management tool we want to use. maven and gradle are the two valid options at this time.

--groupID

The groupId to use in our Maven coordinates for our pom.xml. Unfortunately this does not properly extend to the Java package names that get created; these need to be modified by hand.

--version

The version of our application. This will be used in later iterations, so set to 1.0.

--java-version

The build compiler version for the JDK.

--dependencies

This is an interesting parameter; we can specify fully baked sets of dependencies for doing common types of development. For example, web will set up Spring MVC and embed an internal servlet engine (Tomcat by default, Jetty and Undertow as options). Other convenient dependency bundles/starters include jpa, security, and cassandra).

Download Download