From dfc57517c8fd60f862029d95c25aa01410578c69 Mon Sep 17 00:00:00 2001 From: Kamal Wickramanayake Date: Sat, 28 Mar 2026 21:06:57 +0530 Subject: Added hello webapp sample application --- maven/02-hello-webapp/.gitignore | 1 + maven/02-hello-webapp/.mvn/jvm.config | 0 maven/02-hello-webapp/.mvn/maven.config | 0 maven/02-hello-webapp/README | 11 ++++ maven/02-hello-webapp/pom.xml | 67 ++++++++++++++++++++++ .../src/main/webapp/WEB-INF/web.xml | 10 ++++ maven/02-hello-webapp/src/main/webapp/index.jsp | 5 ++ 7 files changed, 94 insertions(+) create mode 100644 maven/02-hello-webapp/.gitignore create mode 100644 maven/02-hello-webapp/.mvn/jvm.config create mode 100644 maven/02-hello-webapp/.mvn/maven.config create mode 100644 maven/02-hello-webapp/README create mode 100644 maven/02-hello-webapp/pom.xml create mode 100644 maven/02-hello-webapp/src/main/webapp/WEB-INF/web.xml create mode 100644 maven/02-hello-webapp/src/main/webapp/index.jsp diff --git a/maven/02-hello-webapp/.gitignore b/maven/02-hello-webapp/.gitignore new file mode 100644 index 0000000..eb5a316 --- /dev/null +++ b/maven/02-hello-webapp/.gitignore @@ -0,0 +1 @@ +target diff --git a/maven/02-hello-webapp/.mvn/jvm.config b/maven/02-hello-webapp/.mvn/jvm.config new file mode 100644 index 0000000..e69de29 diff --git a/maven/02-hello-webapp/.mvn/maven.config b/maven/02-hello-webapp/.mvn/maven.config new file mode 100644 index 0000000..e69de29 diff --git a/maven/02-hello-webapp/README b/maven/02-hello-webapp/README new file mode 100644 index 0000000..2f95e85 --- /dev/null +++ b/maven/02-hello-webapp/README @@ -0,0 +1,11 @@ +mvn archetype:generate + +Select org.apache.maven.archetypes:maven-archetype-webapp as the archetype. + +Run below command to generate a .war file (web application archive) + + mvn clean package + +Copy the generated hello.war file (inside the target directory) to the webapps directory of Tomcat installation. + +Access the URL: http://localhost:8080/hello/ diff --git a/maven/02-hello-webapp/pom.xml b/maven/02-hello-webapp/pom.xml new file mode 100644 index 0000000..469ed31 --- /dev/null +++ b/maven/02-hello-webapp/pom.xml @@ -0,0 +1,67 @@ + + + + 4.0.0 + + com.example.test + hello + 1.0-SNAPSHOT + war + + hello Maven Webapp + + http://www.example.com + + + UTF-8 + 8 + 8 + + + + + junit + junit + 4.13.1 + test + + + + + hello + + + + maven-clean-plugin + 3.4.0 + + + + maven-resources-plugin + 3.3.1 + + + maven-compiler-plugin + 3.13.0 + + + maven-surefire-plugin + 3.3.0 + + + maven-war-plugin + 3.4.0 + + + maven-install-plugin + 3.1.2 + + + maven-deploy-plugin + 3.1.2 + + + + + diff --git a/maven/02-hello-webapp/src/main/webapp/WEB-INF/web.xml b/maven/02-hello-webapp/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..b9c921f --- /dev/null +++ b/maven/02-hello-webapp/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,10 @@ + + + Archetype Created Web Application + diff --git a/maven/02-hello-webapp/src/main/webapp/index.jsp b/maven/02-hello-webapp/src/main/webapp/index.jsp new file mode 100644 index 0000000..ee89d62 --- /dev/null +++ b/maven/02-hello-webapp/src/main/webapp/index.jsp @@ -0,0 +1,5 @@ + + +

<%= "Hello World!" %>

+ + -- cgit v1.2.3