In my Maven Spring Boot web app project, with a React front-end. This results in the following source directory structure:
The react app is in the client
folder.
Up until now I was deploying this as a self-executing jar file (embedded Tomcat) inside a Docker container, and working fine. Now I want to package a deployable war file.
I changed
<packaging>jar</packaging>
to
<packaging>war</packaging>
I have the following Build Plugins:
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.2</version>
</plugin>
</plugins>
But apparently this isn’t all that’s needed to get a packaged war that can be deployed into Tomcat’s webapps
dir.
The resulting war has no files (html, css, js) at the root level – they are all
in WEB-INF/classes/static and WEB-INF/classes/templates
The folder /WEB-INF/classes/static/client contains my React project – including all the source files.
What other steps are needed to create a deployable war?