InterviewSolution
| 1. |
How do you make sure your changes are loaded without restarting the Spring Boot Application when running in Embedded Server mode? |
|
Answer» You can achieve this by adding a starter dependency for DEV tools. <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <version>2.1.6.RELEASE</version> </dependency>This is a very helpful feature in development, as it gives immediate feedback for code changes. This ENHANCES the productivity of developers to a great extent by saving time in restarts. This is not a production-ready tool or feature and will be automatically disabled when RUNNING in production. Applications using DevTools restart whenever a file on the classpath is modified. Spring Boot DevTools PROVIDE the following additional features :
To enable remote Debugging via HTTP, make sure you have following settings inside pom file <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <excludeDevtools>false</excludeDevtools> </configuration> </plugin> </plugins> </build>Now when starting application , add following parameters to enable remote debugging : -Xdebug -Xrunjdwp:server=y,transport=dt_socket,suspend=nTo change port for debugger , add following to application.properties file ( configuration file ) : spring.devtools.remote.debug.local-port=8010 The default debugger port is 8000. |
|