← Spring Boot learning pathSpring Boot · Module 10 of 10
Packaging and deployment
Build JARs, containers and deploy to the cloud.
📖 Key ideas
- mvn package or ./gradlew build creates an executable JAR.
- Build images with Dockerfile or ./mvnw spring-boot:build-image.
- Deploy to AWS, Azure, Google Cloud Run, Kubernetes or a VM.
- Database migrations with Flyway or Liquibase run on startup.
- Tune JVM memory and use graceful shutdown.
💡 Real-life example: A fat JAR is a packed suitcase: everything the trip needs, including the server, in one bag.
Fat JARExecutable JAR with all dependencies
FlywayVersioned database migrations
BuildpacksBuild images without Dockerfiles
Graceful shutdownFinish requests before stopping