A lightweight Java Servlet/JSP web application packaged as a WAR file for deployment to Apache Tomcat.
This repository demonstrates a Maven-based Java web application with a Jenkins CI/CD pipeline that automates build, testing, deployment, and post-deployment validation.
.
├── Jenkinsfile
├── README.md
├── images
│ ├── tomcat-server.png
│ └── webapp.png
├── pom.xml
└── src
└── main
├── java
│ └── com
│ └── rsstore
│ ├── model
│ │ └── Product.java
│ └── servlet
│ ├── CartServlet.java
│ └── ProductServlet.java
└── webapp
├── WEB-INF
│ └── web.xml
├── cart.jsp
├── index.jsp
└── products.jsp
- Java JDK
- Apache Maven 3.x
- Apache Tomcat 9+ (with Manager API enabled)
- Jenkins Server
- Jenkins Agent (optional, but recommended)
Build the WAR package:
mvn clean packageOutput:
target/rs-shoe-apparel.war
Important
Manual deployment via SCP requires SSH access and appropriate permissions on the target Tomcat server. Alternatively, use rsync to reduce security overheads.
Copy the WAR file to the Tomcat server:
scp target/rs-shoe-apparel.war \
tomcat@<server-ip>:/path/to/apache-tomcat/webapps/Restart Tomcat:
sudo systemctl restart tomcatIf you're unsure of the Tomcat service name:
systemctl list-units --type=service | grep -i tomcatThis repository includes a Jenkins Declarative Pipeline that automates the software delivery process.
Checkout
↓
Compile & Test
↓
Build & Package
↓
Archive Versioned Artifact
↓
Deploy to Tomcat
↓
Smoke Test
- Source code checkout from GitHub
- Maven-based compilation and testing
- WAR packaging
- Versioned build artifacts using Jenkins build numbers
- Artifact archival and fingerprinting
- Deployment through Tomcat Manager API
- Post-deployment smoke testing
- Jenkins credential management
- Build retention policy
Each successful build generates a uniquely versioned WAR file:
rs-shoe-apparel-v1.0.68.war
rs-shoe-apparel-v1.0.69.war
rs-shoe-apparel-v1.0.70.war
These artifacts are archived in Jenkins to provide build traceability and support future rollback scenarios.
After deployment, verify:
- The application is accessible through Tomcat.
- The deployment completed successfully in Jenkins.
Example URL:
http://<server-ip>:<tomcat-port>/rs-shoe-apparel
Remove locally generated build artifacts:
mvn clean


