Spring Boot

Spring Boot DevTools

DevTools for development: live reload, automatic restart, dev configurations, remote debugging

15 면접 질문·
Junior
1

What is Spring Boot DevTools?

답변

Spring Boot DevTools is a development module that enhances developer experience with features like automatic restart (auto-restart on code changes), LiveReload (automatic browser refresh), and remote debugging. DevTools is automatically disabled in production (detected via JAR/WAR packaging) to avoid performance impact. This optional dependency significantly accelerates the development cycle by reducing manual restarts.

2

Which DevTools feature allows automatic browser refresh?

답변

LiveReload is an embedded server that listens on port 35729 and triggers automatic browser refresh whenever a resource (HTML, CSS, JS, images) is modified in the classpath. Unlike automatic restart which restarts the Spring context, LiveReload focuses on front-end assets for immediate visual feedback. A LiveReload browser extension must be installed to establish the WebSocket connection with the DevTools server.

3

How to add Spring Boot DevTools to a Maven project?

답변

DevTools is added as a Maven dependency with optional scope and true in the configuration. The optional scope ensures DevTools won't be transitive to projects depending on yours, while true allows excluding DevTools during production packaging (spring-boot-maven-plugin with excludeDevtools). This double protection ensures DevTools stays strictly in the development environment. The optional scope is the best practice for development-only dependencies.

4

What is the behavior of DevTools in production?

5

What is the main advantage of DevTools automatic restart?

+12 면접 질문

다음 면접을 위해 Spring Boot을 마스터하세요

모든 질문, flashcards, 기술 테스트, 코드 리뷰 연습, 면접 시뮬레이터에 접근하세요.

무료로 시작하기