Packaging Spring Boot
In this section, we will package the Spring Boot application and the Angular application. The idea is to combine the two applications, giving you one single JAR file to deploy. Let’s learn how to do this.
After all the configurations we did, now, it’s a matter of running the following Maven commands in the same order:
mvn clean mvn package
The mvn clean
command cleans the Maven project by deleting the target directory, whereas the mvn package
command builds the Maven project and creates an executable JAR file.
These two Maven commands are enough to create an executable JAR file with the Spring Boot and Angular packages inside it; see Figure 16.2:
Figure 16.2 – Target folder with the JAR file inside
Packaging the applications is simple since we already did all the hard work configuring the Angular and Spring Boot applications.
Now, we have the JAR file. In the next section, we will run the JAR file...