Deployment options
In this section, we will explain which options we have regarding Spring application deployment. As you already know, we are using Spring Boot in this project, and this means that Spring Boot provides a public static void main entry point that launches an embedded web server for you.
The assemble
command we recently performed created a fat JAR for us, so all dependencies are included. If we run the application like we did in the previous section by running $ java - jar api-0.0.1-SNAPSHOT.jar
.
We will also start the embedded server, and our application will start listening on the port defined in the application.properties
file.
Deploying the Tomcat application server
By running our JAR, Spring Boot will detect that you have Spring MVC controller and will start up an embedded Apache Tomcat instance. This is its default behavior.
Once the server is running, you will be able to access your application, like we did use Postman in the previous section.
To customize Tomcat, we can use...