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 verify

ShopEase Dependencies You Will Add Over the Course

Starter / libraryAdded inWhy
spring-boot-starter-webbasicREST API + embedded Tomcat + Jackson
spring-boot-devtoolsbasicautomatic restart during development
spring-boot-starter-validationmediumvalidate request bodies
spring-boot-starter-data-jpa + mysql-connector-jmediumdatabase (see Hibernate & JPA material)
spring-boot-starter-securitySpring Security materiallogin, JWT, roles
spring-boot-starter-actuatoradvancehealth 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 -->