How to create a Web application from the command line

One of the simplest choices to create a Java Web application with Maven is the maven-archetype-webapp. This archetype provides a minimal skeleton for creating a Web application. To create an application using this archetype in batch mode, you can use the following command:

$ mvn archetype:generate -DgroupId=com.sample -DartifactId=web-project -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false

Here is the resulting project:

├── pom.xml
└── src
    └── main
        ├── resources
        └── webapp
            ├── index.jsp
            └── WEB-INF
                └── web.xml

Within the webapp folder, you can add the web pages (JSP/HTML) of your Web application. In the resources folder you can add all files or libraries that will be included automatically in the Web application’s classpath.

Next, if you are developing a Jakarta EE application for WildFly, it is recommended to include in the pom.xml the following dependencies and the WildFly plugin so that you can deploy directly from the Command Line:

<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">
	<name>Jakarta EE example project</name>
	<description>A starter Jakarta EE Project</description>