From 62c172f814477018996c44b06d2d8fa246c410fa Mon Sep 17 00:00:00 2001 From: panos-kakos <102670093+panos-kakos@users.noreply.github.com> Date: Wed, 13 Dec 2023 21:58:43 +0200 Subject: [PATCH] =?UTF-8?q?[JAVA-27376]=20Moved=20article=20"Programmatica?= =?UTF-8?q?lly=20Restarting=20a=20Spring=20Boot=E2=80=A6=20(#15412)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [JAVA-27376] Moved article "Programmatically Restarting a Spring Boot Application" to spring-boot-runtime-2 module * [JAVA-27367] --- spring-boot-modules/spring-boot-runtime-2/README.md | 3 +++ spring-boot-modules/spring-boot-runtime-2/pom.xml | 12 ++++++++++++ .../main/java/com/baeldung/restart/Application.java | 0 .../java/com/baeldung/restart/RestartController.java | 0 .../java/com/baeldung/restart/RestartService.java | 2 +- .../src/main/resources/application.properties | 7 +++++++ .../restart/RestartApplicationManualTest.java | 0 spring-boot-modules/spring-boot-runtime/README.md | 3 ++- 8 files changed, 25 insertions(+), 2 deletions(-) rename spring-boot-modules/{spring-boot-runtime => spring-boot-runtime-2}/src/main/java/com/baeldung/restart/Application.java (100%) rename spring-boot-modules/{spring-boot-runtime => spring-boot-runtime-2}/src/main/java/com/baeldung/restart/RestartController.java (100%) rename spring-boot-modules/{spring-boot-runtime => spring-boot-runtime-2}/src/main/java/com/baeldung/restart/RestartService.java (100%) create mode 100644 spring-boot-modules/spring-boot-runtime-2/src/main/resources/application.properties rename spring-boot-modules/{spring-boot-runtime => spring-boot-runtime-2}/src/test/java/com/baeldung/restart/RestartApplicationManualTest.java (100%) diff --git a/spring-boot-modules/spring-boot-runtime-2/README.md b/spring-boot-modules/spring-boot-runtime-2/README.md index 3ee05ccc83..c22f7cbc18 100644 --- a/spring-boot-modules/spring-boot-runtime-2/README.md +++ b/spring-boot-modules/spring-boot-runtime-2/README.md @@ -5,3 +5,6 @@ This module contains articles about administering a Spring Boot runtime ### Relevant Articles: - [Configure the Heap Size When Starting a Spring Boot Application](https://www.baeldung.com/spring-boot-heap-size) - [Max-HTTP-Header-Size in Spring Boot 2](https://www.baeldung.com/spring-boot-max-http-header-size) + - [Programmatically Restarting a Spring Boot Application](https://www.baeldung.com/java-restart-spring-boot-app) + + - More articles: [[<-- prev]](../spring-boot-runtime) diff --git a/spring-boot-modules/spring-boot-runtime-2/pom.xml b/spring-boot-modules/spring-boot-runtime-2/pom.xml index 5174900c79..356880975a 100644 --- a/spring-boot-modules/spring-boot-runtime-2/pom.xml +++ b/spring-boot-modules/spring-boot-runtime-2/pom.xml @@ -28,6 +28,15 @@ org.springframework.security spring-security-test + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.cloud + spring-cloud-starter + ${springcloud.version} + @@ -64,4 +73,7 @@ + + 3.1.3 + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/restart/Application.java b/spring-boot-modules/spring-boot-runtime-2/src/main/java/com/baeldung/restart/Application.java similarity index 100% rename from spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/restart/Application.java rename to spring-boot-modules/spring-boot-runtime-2/src/main/java/com/baeldung/restart/Application.java diff --git a/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/restart/RestartController.java b/spring-boot-modules/spring-boot-runtime-2/src/main/java/com/baeldung/restart/RestartController.java similarity index 100% rename from spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/restart/RestartController.java rename to spring-boot-modules/spring-boot-runtime-2/src/main/java/com/baeldung/restart/RestartController.java diff --git a/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/restart/RestartService.java b/spring-boot-modules/spring-boot-runtime-2/src/main/java/com/baeldung/restart/RestartService.java similarity index 100% rename from spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/restart/RestartService.java rename to spring-boot-modules/spring-boot-runtime-2/src/main/java/com/baeldung/restart/RestartService.java index 9883ec653b..f197efb067 100644 --- a/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/restart/RestartService.java +++ b/spring-boot-modules/spring-boot-runtime-2/src/main/java/com/baeldung/restart/RestartService.java @@ -1,8 +1,8 @@ package com.baeldung.restart; -import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cloud.context.restart.RestartEndpoint; +import org.springframework.stereotype.Service; @Service public class RestartService { diff --git a/spring-boot-modules/spring-boot-runtime-2/src/main/resources/application.properties b/spring-boot-modules/spring-boot-runtime-2/src/main/resources/application.properties new file mode 100644 index 0000000000..f6bd08e5dd --- /dev/null +++ b/spring-boot-modules/spring-boot-runtime-2/src/main/resources/application.properties @@ -0,0 +1,7 @@ +management.endpoints.web.exposure.include=* +management.metrics.enable.root=true +management.metrics.enable.jvm=true +management.endpoint.restart.enabled=true +spring.datasource.jmx-enabled=false +spring.jmx.enabled=true +management.endpoint.shutdown.enabled=true \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-runtime/src/test/java/com/baeldung/restart/RestartApplicationManualTest.java b/spring-boot-modules/spring-boot-runtime-2/src/test/java/com/baeldung/restart/RestartApplicationManualTest.java similarity index 100% rename from spring-boot-modules/spring-boot-runtime/src/test/java/com/baeldung/restart/RestartApplicationManualTest.java rename to spring-boot-modules/spring-boot-runtime-2/src/test/java/com/baeldung/restart/RestartApplicationManualTest.java diff --git a/spring-boot-modules/spring-boot-runtime/README.md b/spring-boot-modules/spring-boot-runtime/README.md index 6463aaa6c3..44b217ae77 100644 --- a/spring-boot-modules/spring-boot-runtime/README.md +++ b/spring-boot-modules/spring-boot-runtime/README.md @@ -4,10 +4,11 @@ This module contains articles about administering a Spring Boot runtime ### Relevant Articles: - [Shutdown a Spring Boot Application](https://www.baeldung.com/spring-boot-shutdown) - - [Programmatically Restarting a Spring Boot Application](https://www.baeldung.com/java-restart-spring-boot-app) - [Logging HTTP Requests with Spring Boot Actuator HTTP Tracing](https://www.baeldung.com/spring-boot-actuator-http) - [Spring Boot Embedded Tomcat Logs](https://www.baeldung.com/spring-boot-embedded-tomcat-logs) - [Project Configuration with Spring](https://www.baeldung.com/project-configuration-with-spring) - [Spring – Log Incoming Requests](https://www.baeldung.com/spring-http-logging) - [How to Configure Spring Boot Tomcat](https://www.baeldung.com/spring-boot-configure-tomcat) - [CORS with Spring](https://www.baeldung.com/spring-cors) + + - More articles: [[more -->]](../spring-boot-runtime-2)