Careeroza
Real World Example
Builds in a Real Team
At a company like Paytm or an Infosys client project, nobody builds on their laptop for production. A CI server (GitHub Actions, Jenkins, GitLab CI) checks out the code and runs the wrapper on every pull request:
git push -> CI server -> ./mvnw -B clean verify -> tests pass? -> build jar -> deploy
| no
+-> PR blocked, developer fixes# .github/workflows/build.yml (simplified)
name: build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: maven
- run: ./mvnw -B clean verifyShopEase Dependencies You Will Add Over the Course
| Starter / library | Added in | Why |
|---|---|---|
spring-boot-starter-web | basic | REST API + embedded Tomcat + Jackson |
spring-boot-devtools | basic | automatic restart during development |
spring-boot-starter-validation | medium | validate request bodies |
spring-boot-starter-data-jpa + mysql-connector-j | medium | database (see Hibernate & JPA material) |
spring-boot-starter-security | Spring Security material | login, JWT, roles |
spring-boot-starter-actuator | advance | health and metrics |
Practice
Exercise: Add the validation starter to the ShopEase pom.xml. Which version do you write, and how do you check it was downloaded?
Show answer
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<!-- No version: spring-boot-starter-parent manages it.
Check: ./mvnw dependency:tree | grep validation
-> org.springframework.boot:spring-boot-starter-validation:jar:3.5.6:compile -->