Packaging and deployment
19 questions in 7 subtopics.
Executable jars
What is inside a Spring Boot executable jar and how does java -jarapp.jar start the application?An application started with java -cp app.jar com.acme.Main fails with ClassNotFoundException for Spring classes, but java -jar app.jar works. Why?Java deployment went from application servers and EARs to executable jars, containers and now native images. Looking back, what drove each step and what would you expect next?Layered jars
What are layered jars and why do they speed up Docker image builds?Write a multi-stage Dockerfile for a Boot application that uses layered jar extraction, and explain the order of COPY instructions.Buildpacks and container images
How do you build a container image with Cloud Native Buildpacks in Spring Boot, without a Dockerfile?Should your organisation standardise on buildpacks or Dockerfiles for 200 Java services? Compare them and make a recommendation.Container base images and buildpacks are a large part of your security exposure. How would you set long-term ownership and patching for images across hundreds of services?War deployment
What changes do you need to deploy a Spring Boot 3 application as a war to an external Tomcat?A company still deploys 50 Spring applications as wars to shared application servers and wants to move to containers. How would you plan this?Running on Kubernetes
Which Kubernetes settings matter most for a Spring Boot service, and how does Boot help with them?A Boot service in Kubernetes is OOMKilled although -Xmx is 1 GB and the memory limit is 1.2 GB. Why?Define the deployment standards for Spring Boot services on Kubernetes across your organisation.Your company runs Spring services on Kubernetes today. How would you keep the option of moving to another runtime, such as a serverless platform, in the future?Configuration in containers
What is the best way to give the same container image different configuration in dev, test and production?A ConfigMap was updated but the running Spring Boot pods still use the old values. Why, and what are the options?Deploying to cloud platforms
You need to deploy a Spring Boot service to a managed platform such as Google Cloud Run, Azure App Service, AWS App Runner or Cloud Foundry. What does the application need to do to run well there, and what does Spring Boot detect automatically?A Spring Boot service on Google Cloud Run has slow first requests after idle periods, scheduled@Scheduled jobs that sometimes do not run, and lost messages during deployments. Explain the platform behaviours behind each problem and the fixes.Managed application platforms come and go: some popular Java platforms have been retired by their vendors, forcing customers to migrate within a few years. How do you choose deployment platforms for your company's Java services so that a platform retirement does not become a crisis?No question matches these choices.