Configuring a web project with Maven
The first step to crafting a web app is to configure your project for Maven. First, we need to create the appropriate folder structure for any Jakarta EE application built with Maven. Here is what you need to set it up:
Figure 14.3 – The required folders for a Jakarta EE app being built with Maven
The only difference between a Maven desktop setup and a web setup is the addition of the webapp
folder in the main
folder. In this folder is a WEB-INF
folder and an optional styles
folder. Here is a rundown of the folder:
src/main/java
: All Java source files are stored in subfolders/packages, just as we did in a desktop app.src/main/resources/
: Language bundles and logger configuration files go here. Some bundles can be placed in subfolders while others cannot.src/main/webapp
: This is the folder that will contain any static web pages, JavaServer pages, and JavaServer Faces pages. You can create subfolders...