How tejassushanth/demo-java works
1. Project type
- This is a minimal Java web application packaged as a WAR.
- It is built with Maven and intended to run in a servlet container such as Tomcat or Jetty.
2. Core application shape
- The runtime application is very small: one Java servlet plus JSP-based web resources.
- Main code lives in src/main/java/com/example/HelloServlet.java.
- Web entry points live in src/main/webapp, with index.jsp as the landing page.
3. Request/response flow
- A browser hits the web app through the servlet container.
- index.jsp serves the initial page.
- HelloServlet handles backend HTTP request processing and returns a response into the web layer.
- WEB-INF/web.xml is the deployment descriptor that defines servlet wiring and URL mapping.
4. Web layer boundary
- src/main/webapp is the presentation boundary for the app.
- WEB-INF/web.xml keeps deployment configuration private to the server.
- index.jsp is public-facing content, while the servlet is the server-side logic endpoint.
5. Build and packaging
- pom.xml drives compilation, packaging, and dependency management.
- The output artifact is target/my-java-app-1.0-SNAPSHOT.war.
- The exploded WAR under target/my-java-app-1.0-SNAPSHOT/ shows the final deployable structure that a servlet container would load.
6. Generated build outputs
- Everything under target/ is generated and not source-of-truth.
- It contains compiled classes, Maven metadata, and the expanded WAR layout.
- For an architecture diagram, this is the build output boundary between source and deployable artifact.
7. Automation and CI/CD
- The repository includes a Jenkinsfile, so Jenkins is part of the delivery pipeline.
- .github/workflows/sonarbuild.yml indicates GitHub Actions is also used for automated build/quality checks.
- The README mentions webhook-triggered push deployment, sudo-based deployment, and email completion notifications, so the pipeline likely includes deployment and notification steps beyond just compilation.
8. Local/operational script
- run.sh is likely the local start or convenience script for running the app or container.
- This suggests a manual execution path in addition to CI/CD automation.
9. Technology boundaries
- Java + Servlet/JSP define the application runtime model.
- Maven defines the build/package model.
- Jenkins / GitHub Actions / Sonar define the delivery and quality gates.
- The actual production runtime boundary is the servlet container that consumes the WAR.
10. What is not present
- There is no evidence of a database, message broker, REST API layer, or separate frontend framework.
- The architecture is intentionally simple: a single-module server-rendered Java web app with CI/CD around it.
11. How to draw it
- Show three main zones: source code, CI/CD pipeline, and deployable WAR/runtime.
- Inside source code, place HelloServlet, index.jsp, and web.xml.
- On the pipeline side, place Maven build, Sonar/quality checks, Jenkins/GitHub Actions, deployment, and email notification.
- On the runtime side, show the WAR deployed to a servlet container serving browser requests.
Main entry points: pom.xml pom.xml · my-java-app-1.0-SNAPSHOT Deployed app · Jenkinsfile Jenkinsfile · my-java-app-1.0-SNAPSHOT.war WAR artifact
Components 17
Source code
Authoritative application source and web resources.
- pom.xml · Maven project definition for compilation, packaging, and dependencies.
pom.xml - HelloServlet · Server-side HTTP request handler.
src/main/java/com/example/HelloServlet.java - index.jsp · Public landing page rendered by the web layer.
src/main/webapp/index.jsp - web.xml · Private servlet wiring and URL mapping configuration.
src/main/webapp/WEB-INF/web.xml - Web app · Presentation boundary containing JSPs and deployment metadata.
src/main/webapp - Java source · Main Java application source tree.
src/main/java
Build output
Generated Maven artifacts and exploded WAR layout.
- WAR artifact · Packaged application artifact produced by Maven.
target/my-java-app-1.0-SNAPSHOT.war - Exploded WAR · Expanded deployable structure used by servlet containers.
target/my-java-app-1.0-SNAPSHOT - Compiled classes · Compiled Java bytecode generated during the build.
target/classes - Maven meta · Archived Maven packaging metadata.
target/maven-archiver - Compiler status · Maven compiler plugin tracking files and inputs.
target/maven-status
CI/CD
Automation for build, quality, deployment, and notifications.
- Jenkinsfile · Jenkins delivery pipeline definition.
Jenkinsfile - Sonar workflow · GitHub Actions workflow for automated build and quality checks.
.github/workflows/sonarbuild.yml - run.sh · Local convenience script for manual execution or startup.
run.sh
Runtime
Servlet-container deployment and request handling.
- Browser · User request source entering the web application.
- Servlet container · Tomcat or Jetty-style container that loads the WAR.
- Deployed app · WAR deployed and expanded inside the servlet container.
target/my-java-app-1.0-SNAPSHOT
Connections 20
- Browser → Servlet container: HTTP request · Browser traffic enters the servlet container.
- Servlet container → Deployed app: loads WAR · The container consumes the packaged application for deployment.
- Deployed app → index.jsp: serves page · The deployed webapp exposes the landing page.
- Deployed app → HelloServlet: dispatches to · Servlet mappings route requests to backend logic.
- web.xml → HelloServlet: maps servlet · Deployment descriptor defines servlet wiring and URL mapping.
- Web app → index.jsp: contains · Web resources include the public JSP entry point.
- Web app → web.xml: contains · Web resources include private deployment configuration.
- Java source → HelloServlet: contains · Main Java source tree holds the servlet implementation.
- pom.xml → WAR artifact: packages · Maven builds the deployable WAR artifact.
- pom.xml → Compiled classes: compiles · Maven compiles application classes into build output.
- pom.xml → Maven meta: archives · Maven writes packaging metadata during the build.
- pom.xml → Compiler status: tracks · Compiler plugin status files are generated during compilation.
- WAR artifact → Exploded WAR: expands to · The packaged WAR is expanded into deployable layout.
- Exploded WAR → Deployed app: deployed as · Expanded WAR structure matches what the container loads.
- Jenkinsfile → pom.xml: runs build · Jenkins orchestrates Maven build and packaging.
- Sonar workflow → pom.xml: runs build · GitHub Actions executes build and quality checks.
- Jenkinsfile → WAR artifact: publishes · Pipeline produces the deployable artifact.
- Jenkinsfile → Deployed app: deploys · Delivery pipeline promotes the app to runtime.
- Sonar workflow → Compiler status: checks quality · Automated workflow likely runs build and analysis gates.
- run.sh → Servlet container: starts · Local script provides a manual run path.