Setting up the application build
Whatever the pom.xml
files, whatever we have used until now is enough to execute our sample REST service. This service would package the code into a JAR file. To make this JAR executable we need to opt for the following options:
- Running the Maven tool
- Executing with the Java command
The following sections will cover them in detail.
Running the Maven tool
This method may not work because Java 9, Spring Boot 2, and Spring Framework 5 are all in either in early or snapshot release. In case it does not work, please use a project using Java commands.
Here, we use the Maven tool to execute the generated JAR file, the steps for this are as follows:
- Right-click on the
pom.xml
file. - Select
Run Maven
|Goals...
from the pop-up menu. It will open the dialog. Typespring-boot:run
in theGoals
field. We have used the released version of Spring Boot in the code. However, if you are using the snapshot release, you can check theUpdate Snapshots
checkbox. To use it in the future...