Spring Boot

Spring Boot DevTools

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

15 perguntas de entrevista·
Junior
1

What is Spring Boot DevTools?

Resposta

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?

Resposta

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?

Resposta

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 perguntas de entrevista

Domine Spring Boot para sua proxima entrevista

Acesse todas as perguntas, flashcards, testes tecnicos, exercicios de code review e simuladores de entrevista.

Comece gratis