Operations 9 min read

Automate SpringBoot E‑Commerce Deployment with Jenkins & Docker: Step‑by‑Step Guide

Learn how to set up Jenkins in Docker, configure essential plugins, and create pipeline jobs to automatically build and deploy the SpringBoot‑based mall e‑commerce project—including admin, portal, and search modules—so you can achieve one‑click deployments without manual command errors.

macrozheng
macrozheng
macrozheng
Automate SpringBoot E‑Commerce Deployment with Jenkins & Docker: Step‑by‑Step Guide

Jenkins Overview

Jenkins is a leading open‑source automation server built with Java, offering over 1800 plugins to automate virtually any task.

Mall Project Introduction

The mall project is a SpringBoot3 + Vue e‑commerce system (≈60K GitHub stars) with a modular backend and a microservice architecture, deployed via Docker and Kubernetes. It includes modules for products, orders, carts, permissions, coupons, members, payments, etc.

Boot repository: https://github.com/macrozheng/mall

Cloud (Docker/K8s) repository: https://github.com/macrozheng/mall-swarm

Video tutorials: https://www.macrozheng.com/video/

Installing Jenkins with Docker

Use Docker to pull and run the Jenkins image:

docker pull jenkins/jenkins:lts
docker run -p 8180:8080 -p 50000:50000 --name jenkins \
    -u root \
    -v /mydata/jenkins_home:/var/jenkins_home \
    -d jenkins/jenkins:lts

After the container starts, retrieve the initial admin password:

docker logs -f jenkins

Jenkins Configuration

Install the recommended plugins.

Create an admin account.

Configure the Jenkins URL (e.g., http://192.168.3.101:8180/).

Install the SSH plugin to enable remote command execution.

In Global Tool Configuration , add Maven.

In Configure System , add global SSH credentials for the target Linux host.

One‑Click Deployment of SpringBoot Projects

Prepare deployment scripts in the project’s /document/sh directory and upload them to the Linux server’s /mydata/sh directory, making them executable.

Creating Jenkins Jobs for the Mall Modules

Example: mall‑admin job

Select “Freestyle project” and set the Git repository to https://gitee.com/macrozheng/mall.

Add a build step to compile the common, mbg, and security modules:

# install only mall-common, mall-mbg, mall-security
clean install -pl mall-common,mall-mbg,mall-security -am

Add a second build step to package the mall-admin module: clean package Add a third build step that uses the SSH plugin to run the remote script /mydata/sh/mall-admin.sh.

Save the job and trigger it to deploy the admin service. After a successful run, the API documentation is available at http://192.168.3.101:8080/swagger-ui/ and the admin UI at http://192.168.3.101/admin/.

Deploying Other Modules

For mall‑portal and mall‑search , copy the mall-admin job, adjust the pom.xml path and the SSH command to point to the respective module scripts. After execution, their API docs are reachable at http://192.168.3.101:8085/swagger-ui/ and http://192.168.3.101:8081/swagger-ui/ respectively, and the front‑end can be tested at http://192.168.3.101/app/.

Conclusion

Using Jenkins to deploy SpringBoot projects is straightforward: configure the build steps, click “Build”, and achieve one‑click deployment while avoiding manual command errors.

Project Links

GitHub repository: https://github.com/macrozheng/mall

The accompanying video tutorial (≈26 hours, 59 lessons) covers the latest microservice stack, Spring Cloud core components, and Kubernetes containerization.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Dockerci/cdAutomationDevOpsJenkins
macrozheng
Written by

macrozheng

Dedicated to Java tech sharing and dissecting top open-source projects. Topics include Spring Boot, Spring Cloud, Docker, Kubernetes and more. Author’s GitHub project “mall” has 50K+ stars.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.