Deployment strategies for an Angular / Java application.

Updated:

We want to show how to deploy an application that uses Java as back end and Angular as front end.
It’s a common problem to correctly integrate the 2 technologies because they have their own building system.
You have many options for the deployment.

Option 1. Java .war in 1 server

We use the traditional approach and we deploy our application in a Java EE / Servlet server.

The final maven build should place correctly the web resources as showed in the image:

Angular directory structure

In this case we called the package ROOT.war to deploy the package directly in the context root (e.g. https://localhost:8080/).

Option 2. Multiple servers

It’s even possible to manage the front end and the back end separately.
For the development this is maybe the easiest solution (node.js for the web and tomcat for the back end services).
The 2 servers can be on the same machine.

angular_2_servers


Fullstack Angular / Java application quick start guide.
WebApp built by Marco using SpringBoot 3.2.4 and Java 21. Hosted in Switzerland (GE8).