diff --git a/pom.xml b/pom.xml index 03674dc58f..e44c939a26 100644 --- a/pom.xml +++ b/pom.xml @@ -686,17 +686,20 @@ spring-boot-crud spring-boot-ctx-fluent spring-boot-custom-starter - spring-boot-disable-console-logging spring-boot-jasypt spring-boot-keycloak spring-boot-kotlin spring-boot-logging-log4j2 - spring-boot-management spring-boot-mvc spring-boot-mvc-birt - spring-boot-ops - spring-boot-ops-2 + spring-boot-environment + spring-boot-deployment + spring-boot-runtime + spring-boot-runtime/disabling-console-jul + spring-boot-runtime/disabling-console-log4j2 + spring-boot-runtime/disabling-console-logback + spring-boot-artifacts spring-boot-rest spring-boot-data spring-boot-parent @@ -1412,16 +1415,19 @@ spring-boot-crud spring-boot-ctx-fluent spring-boot-custom-starter - spring-boot-disable-console-logging spring-boot-jasypt spring-boot-keycloak spring-boot-logging-log4j2 - spring-boot-management spring-boot-mvc spring-boot-mvc-birt - spring-boot-ops - spring-boot-ops-2 + spring-boot-environment + spring-boot-deployment + spring-boot-runtime + spring-boot-runtime/disabling-console-jul + spring-boot-runtime/disabling-console-log4j2 + spring-boot-runtime/disabling-console-logback + spring-boot-artifacts spring-boot-rest spring-boot-data spring-boot-parent diff --git a/spring-boot-artifacts/README.md b/spring-boot-artifacts/README.md new file mode 100644 index 0000000000..4025e43a65 --- /dev/null +++ b/spring-boot-artifacts/README.md @@ -0,0 +1,10 @@ +## Spring Boot Artifacts + +This module contains articles about configuring the Spring Boot build process. + +### Relevant Articles: + - [Spring Boot Dependency Management with a Custom Parent](https://www.baeldung.com/spring-boot-dependency-management-custom-parent) + - [Create a Fat Jar App with Spring Boot](https://www.baeldung.com/deployable-fat-jar-spring-boot) + - [Intro to Spring Boot Starters](https://www.baeldung.com/spring-boot-starters) + - [Introduction to WebJars](https://www.baeldung.com/maven-webjars) + - [A Quick Guide to Maven Wrapper](https://www.baeldung.com/maven-wrapper) \ No newline at end of file diff --git a/spring-boot-ops/pom.xml b/spring-boot-artifacts/pom.xml similarity index 83% rename from spring-boot-ops/pom.xml rename to spring-boot-artifacts/pom.xml index f578a24163..8301533606 100644 --- a/spring-boot-ops/pom.xml +++ b/spring-boot-artifacts/pom.xml @@ -2,8 +2,8 @@ 4.0.0 - spring-boot-ops - spring-boot-ops + spring-boot-artifacts + spring-boot-artifacts war Demo project for Spring Boot @@ -101,15 +101,6 @@ ${project.artifactId} - - - src/main/resources - true - - **/conf.properties - - - org.springframework.boot @@ -126,28 +117,28 @@ - org.apache.maven.plugins - maven-failsafe-plugin - 2.18 - - - - integration-tests - - integration-test - verify - - - - - **/ExternalPropertyFileLoaderIntegrationTest.java - - - - - + org.apache.maven.plugins + maven-failsafe-plugin + 2.18 + + + + integration-tests + + integration-test + verify + + + + + **/ExternalPropertyFileLoaderIntegrationTest.java + + + + + diff --git a/spring-boot-ops/src/main/java/com/baeldung/webjar/TestController.java b/spring-boot-artifacts/src/main/java/com/baeldung/webjar/TestController.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/webjar/TestController.java rename to spring-boot-artifacts/src/main/java/com/baeldung/webjar/TestController.java diff --git a/spring-boot-ops/src/main/java/com/baeldung/webjar/WebjarsdemoApplication.java b/spring-boot-artifacts/src/main/java/com/baeldung/webjar/WebjarsdemoApplication.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/webjar/WebjarsdemoApplication.java rename to spring-boot-artifacts/src/main/java/com/baeldung/webjar/WebjarsdemoApplication.java diff --git a/spring-boot-artifacts/src/main/resources/application.properties b/spring-boot-artifacts/src/main/resources/application.properties new file mode 100644 index 0000000000..709574239b --- /dev/null +++ b/spring-boot-artifacts/src/main/resources/application.properties @@ -0,0 +1 @@ +spring.main.allow-bean-definition-overriding=true \ No newline at end of file diff --git a/spring-boot-ops/src/main/resources/logback.xml b/spring-boot-artifacts/src/main/resources/logback.xml similarity index 100% rename from spring-boot-ops/src/main/resources/logback.xml rename to spring-boot-artifacts/src/main/resources/logback.xml diff --git a/spring-boot-ops/src/main/resources/templates/index.html b/spring-boot-artifacts/src/main/resources/templates/index.html similarity index 100% rename from spring-boot-ops/src/main/resources/templates/index.html rename to spring-boot-artifacts/src/main/resources/templates/index.html diff --git a/spring-boot-ops/src/test/java/com/baeldung/webjar/WebjarsdemoApplicationIntegrationTest.java b/spring-boot-artifacts/src/test/java/com/baeldung/webjar/WebjarsdemoApplicationIntegrationTest.java similarity index 100% rename from spring-boot-ops/src/test/java/com/baeldung/webjar/WebjarsdemoApplicationIntegrationTest.java rename to spring-boot-artifacts/src/test/java/com/baeldung/webjar/WebjarsdemoApplicationIntegrationTest.java diff --git a/spring-boot-deployment/README.md b/spring-boot-deployment/README.md new file mode 100644 index 0000000000..6171decf2d --- /dev/null +++ b/spring-boot-deployment/README.md @@ -0,0 +1,9 @@ +## Spring Boot Deployment + +This module contains articles about deployment of a Spring Boot Application + +### Relevant Articles: + - [Deploy a Spring Boot WAR into a Tomcat Server](https://www.baeldung.com/spring-boot-war-tomcat-deploy) + - [Spring Boot Console Application](https://www.baeldung.com/spring-boot-console-app) + - [How to Configure Spring Boot Tomcat](https://www.baeldung.com/spring-boot-configure-tomcat) + - [Comparing Embedded Servlet Containers in Spring Boot](https://www.baeldung.com/spring-boot-servlet-containers) \ No newline at end of file diff --git a/spring-boot-deployment/pom.xml b/spring-boot-deployment/pom.xml new file mode 100644 index 0000000000..69a54fd482 --- /dev/null +++ b/spring-boot-deployment/pom.xml @@ -0,0 +1,203 @@ + + + 4.0.0 + spring-boot-deployment + spring-boot-deployment + war + Demo project for Spring Boot + + + parent-boot-2 + com.baeldung + 0.0.1-SNAPSHOT + ../parent-boot-2 + + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-thymeleaf + provided + + + + org.springframework.boot + spring-boot-starter-test + test + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + + org.springframework.boot + spring-boot-starter-mail + + + + org.springframework.boot + spring-boot-starter-actuator + + + + com.h2database + h2 + runtime + + + + javax.persistence + javax.persistence-api + ${jpa.version} + + + + com.google.guava + guava + ${guava.version} + + + + org.subethamail + subethasmtp + ${subethasmtp.version} + test + + + + org.webjars + bootstrap + ${bootstrap.version} + + + + org.webjars + jquery + ${jquery.version} + + + + org.springframework.cloud + spring-cloud-context + ${springcloud.version} + + + + org.apache.httpcomponents + httpclient + ${httpclient.version} + + + + + + ${project.artifactId} + + + src/main/resources + true + + **/conf.properties + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + com.baeldung.webjar.WebjarsdemoApplication + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.18 + + + + integration-tests + + integration-test + verify + + + + + **/ExternalPropertyFileLoaderIntegrationTest.java + + + + + + + + + + + autoconfiguration + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration-test + + test + + + + **/*LiveTest.java + **/*IntegrationTest.java + **/*IntTest.java + + + **/AutoconfigurationTest.java + + + + + + + json + + + + + + + + + + + org.baeldung.boot.Application + 3.1.1 + 3.3.7-1 + 2.2 + 18.0 + 3.1.7 + 2.0.2.RELEASE + 4.5.8 + + + diff --git a/spring-boot-ops/src/main/java/com/baeldung/compare/ComparisonApplication.java b/spring-boot-deployment/src/main/java/com/baeldung/compare/ComparisonApplication.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/compare/ComparisonApplication.java rename to spring-boot-deployment/src/main/java/com/baeldung/compare/ComparisonApplication.java diff --git a/spring-boot-ops/src/main/java/com/baeldung/compare/StartupEventHandler.java b/spring-boot-deployment/src/main/java/com/baeldung/compare/StartupEventHandler.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/compare/StartupEventHandler.java rename to spring-boot-deployment/src/main/java/com/baeldung/compare/StartupEventHandler.java diff --git a/spring-boot-ops-2/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java b/spring-boot-deployment/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java similarity index 100% rename from spring-boot-ops-2/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java rename to spring-boot-deployment/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java diff --git a/spring-boot-ops-2/src/main/java/com/baeldung/gracefulshutdown/beans/LongRunningProcessBean.java b/spring-boot-deployment/src/main/java/com/baeldung/gracefulshutdown/beans/LongRunningProcessBean.java similarity index 100% rename from spring-boot-ops-2/src/main/java/com/baeldung/gracefulshutdown/beans/LongRunningProcessBean.java rename to spring-boot-deployment/src/main/java/com/baeldung/gracefulshutdown/beans/LongRunningProcessBean.java diff --git a/spring-boot-ops-2/src/main/java/com/baeldung/gracefulshutdown/config/SpringConfiguration.java b/spring-boot-deployment/src/main/java/com/baeldung/gracefulshutdown/config/SpringConfiguration.java similarity index 100% rename from spring-boot-ops-2/src/main/java/com/baeldung/gracefulshutdown/config/SpringConfiguration.java rename to spring-boot-deployment/src/main/java/com/baeldung/gracefulshutdown/config/SpringConfiguration.java diff --git a/spring-boot-ops-2/src/main/java/com/baeldung/springbootconfiguration/SpringBootConfigurationApplication.java b/spring-boot-deployment/src/main/java/com/baeldung/springbootconfiguration/SpringBootConfigurationApplication.java similarity index 100% rename from spring-boot-ops-2/src/main/java/com/baeldung/springbootconfiguration/SpringBootConfigurationApplication.java rename to spring-boot-deployment/src/main/java/com/baeldung/springbootconfiguration/SpringBootConfigurationApplication.java diff --git a/spring-boot-ops-2/src/main/java/com/baeldung/springbootconfiguration/controller/GreetingsController.java b/spring-boot-deployment/src/main/java/com/baeldung/springbootconfiguration/controller/GreetingsController.java similarity index 100% rename from spring-boot-ops-2/src/main/java/com/baeldung/springbootconfiguration/controller/GreetingsController.java rename to spring-boot-deployment/src/main/java/com/baeldung/springbootconfiguration/controller/GreetingsController.java diff --git a/spring-boot-ops/src/main/java/com/baeldung/springbootnonwebapp/SpringBootConsoleApplication.java b/spring-boot-deployment/src/main/java/com/baeldung/springbootnonwebapp/SpringBootConsoleApplication.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/springbootnonwebapp/SpringBootConsoleApplication.java rename to spring-boot-deployment/src/main/java/com/baeldung/springbootnonwebapp/SpringBootConsoleApplication.java diff --git a/spring-boot-ops/src/main/java/com/baeldung/springbootsimple/SpringBootTomcatApplication.java b/spring-boot-deployment/src/main/java/com/baeldung/springbootsimple/SpringBootTomcatApplication.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/springbootsimple/SpringBootTomcatApplication.java rename to spring-boot-deployment/src/main/java/com/baeldung/springbootsimple/SpringBootTomcatApplication.java diff --git a/spring-boot-ops/src/main/java/com/baeldung/springbootsimple/TomcatController.java b/spring-boot-deployment/src/main/java/com/baeldung/springbootsimple/TomcatController.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/springbootsimple/TomcatController.java rename to spring-boot-deployment/src/main/java/com/baeldung/springbootsimple/TomcatController.java diff --git a/spring-boot-ops/src/main/resources/application.properties b/spring-boot-deployment/src/main/resources/application.properties similarity index 100% rename from spring-boot-ops/src/main/resources/application.properties rename to spring-boot-deployment/src/main/resources/application.properties diff --git a/spring-boot-management/src/main/resources/logback.xml b/spring-boot-deployment/src/main/resources/logback.xml similarity index 58% rename from spring-boot-management/src/main/resources/logback.xml rename to spring-boot-deployment/src/main/resources/logback.xml index 36314cbeeb..7d900d8ea8 100644 --- a/spring-boot-management/src/main/resources/logback.xml +++ b/spring-boot-deployment/src/main/resources/logback.xml @@ -1,13 +1,13 @@ - + + - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + - - - + \ No newline at end of file diff --git a/spring-boot-ops-2/src/test/java/com/baeldung/springbootconfiguration/SpringContextIntegrationTest.java b/spring-boot-deployment/src/test/java/com/baeldung/springbootconfiguration/SpringContextIntegrationTest.java similarity index 100% rename from spring-boot-ops-2/src/test/java/com/baeldung/springbootconfiguration/SpringContextIntegrationTest.java rename to spring-boot-deployment/src/test/java/com/baeldung/springbootconfiguration/SpringContextIntegrationTest.java diff --git a/spring-boot-ops-2/src/test/java/com/baeldung/springbootconfiguration/SpringContextTest.java b/spring-boot-deployment/src/test/java/com/baeldung/springbootconfiguration/SpringContextTest.java similarity index 100% rename from spring-boot-ops-2/src/test/java/com/baeldung/springbootconfiguration/SpringContextTest.java rename to spring-boot-deployment/src/test/java/com/baeldung/springbootconfiguration/SpringContextTest.java diff --git a/spring-boot-ops/src/test/java/com/baeldung/springbootsimple/SpringBootTomcatApplicationIntegrationTest.java b/spring-boot-deployment/src/test/java/com/baeldung/springbootsimple/SpringBootTomcatApplicationIntegrationTest.java similarity index 100% rename from spring-boot-ops/src/test/java/com/baeldung/springbootsimple/SpringBootTomcatApplicationIntegrationTest.java rename to spring-boot-deployment/src/test/java/com/baeldung/springbootsimple/SpringBootTomcatApplicationIntegrationTest.java diff --git a/spring-boot-disable-console-logging/README.md b/spring-boot-disable-console-logging/README.md deleted file mode 100644 index 7f1c06042f..0000000000 --- a/spring-boot-disable-console-logging/README.md +++ /dev/null @@ -1,6 +0,0 @@ -## Spring Boot Disable Console Logging - -This module contains articles about disabling Spring Boot console logging. - -### Relevant Articles: -- [How to Disable Console Logging in Spring Boot](https://www.baeldung.com/spring-boot-disable-console-logging) diff --git a/spring-boot-disable-console-logging/pom.xml b/spring-boot-disable-console-logging/pom.xml deleted file mode 100644 index 63ed129347..0000000000 --- a/spring-boot-disable-console-logging/pom.xml +++ /dev/null @@ -1,21 +0,0 @@ - - 4.0.0 - spring-boot-disable-console-logging - spring-boot-disable-console-logging - pom - Projects for Disabling Spring Boot Console Logging tutorials - - - parent-boot-2 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-2 - - - - disabling-console-logback - disabling-console-log4j2 - disabling-console-jul - - \ No newline at end of file diff --git a/spring-boot-environment/README.md b/spring-boot-environment/README.md new file mode 100644 index 0000000000..e916c503bc --- /dev/null +++ b/spring-boot-environment/README.md @@ -0,0 +1,7 @@ +## Spring Boot Environment + +This module contains articles about configuring the Spring Boot `Environment` + +### Relevant Articles: + - [EnvironmentPostProcessor in Spring Boot](https://www.baeldung.com/spring-boot-environmentpostprocessor) + - [Spring Properties File Outside jar](https://www.baeldung.com/spring-properties-file-outside-jar) \ No newline at end of file diff --git a/spring-boot-environment/pom.xml b/spring-boot-environment/pom.xml new file mode 100644 index 0000000000..4e4a363fee --- /dev/null +++ b/spring-boot-environment/pom.xml @@ -0,0 +1,148 @@ + + + 4.0.0 + spring-boot-environment + spring-boot-environment + war + Demo project for Spring Boot + + + parent-boot-2 + com.baeldung + 0.0.1-SNAPSHOT + ../parent-boot-2 + + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-thymeleaf + provided + + + + org.springframework.boot + spring-boot-starter-test + test + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + + org.springframework.boot + spring-boot-starter-mail + + + + org.springframework.boot + spring-boot-starter-actuator + + + + com.h2database + h2 + runtime + + + + javax.persistence + javax.persistence-api + ${jpa.version} + + + + com.google.guava + guava + ${guava.version} + + + + org.subethamail + subethasmtp + ${subethasmtp.version} + test + + + + org.springframework.cloud + spring-cloud-context + ${springcloud.version} + + + + org.apache.httpcomponents + httpclient + ${httpclient.version} + + + + + + ${project.artifactId} + + + src/main/resources + true + + **/conf.properties + + + + + + + + autoconfiguration + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration-test + + test + + + + **/*LiveTest.java + **/*IntegrationTest.java + **/*IntTest.java + + + **/AutoconfigurationTest.java + + + + + + + json + + + + + + + + + + 2.2 + 18.0 + 3.1.7 + 2.0.2.RELEASE + 4.5.8 + + + diff --git a/spring-boot-ops/src/main/java/com/baeldung/environmentpostprocessor/PriceCalculationApplication.java b/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/PriceCalculationApplication.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/environmentpostprocessor/PriceCalculationApplication.java rename to spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/PriceCalculationApplication.java diff --git a/spring-boot-ops/src/main/java/com/baeldung/environmentpostprocessor/PriceCalculationEnvironmentPostProcessor.java b/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/PriceCalculationEnvironmentPostProcessor.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/environmentpostprocessor/PriceCalculationEnvironmentPostProcessor.java rename to spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/PriceCalculationEnvironmentPostProcessor.java diff --git a/spring-boot-ops/src/main/java/com/baeldung/environmentpostprocessor/autoconfig/PriceCalculationAutoConfig.java b/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/autoconfig/PriceCalculationAutoConfig.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/environmentpostprocessor/autoconfig/PriceCalculationAutoConfig.java rename to spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/autoconfig/PriceCalculationAutoConfig.java diff --git a/spring-boot-ops/src/main/java/com/baeldung/environmentpostprocessor/calculator/GrossPriceCalculator.java b/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/calculator/GrossPriceCalculator.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/environmentpostprocessor/calculator/GrossPriceCalculator.java rename to spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/calculator/GrossPriceCalculator.java diff --git a/spring-boot-ops/src/main/java/com/baeldung/environmentpostprocessor/calculator/NetPriceCalculator.java b/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/calculator/NetPriceCalculator.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/environmentpostprocessor/calculator/NetPriceCalculator.java rename to spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/calculator/NetPriceCalculator.java diff --git a/spring-boot-ops/src/main/java/com/baeldung/environmentpostprocessor/calculator/PriceCalculator.java b/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/calculator/PriceCalculator.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/environmentpostprocessor/calculator/PriceCalculator.java rename to spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/calculator/PriceCalculator.java diff --git a/spring-boot-ops/src/main/java/com/baeldung/environmentpostprocessor/service/PriceCalculationService.java b/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/service/PriceCalculationService.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/environmentpostprocessor/service/PriceCalculationService.java rename to spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/service/PriceCalculationService.java diff --git a/spring-boot-ops/src/main/java/com/baeldung/properties/ConfProperties.java b/spring-boot-environment/src/main/java/com/baeldung/properties/ConfProperties.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/properties/ConfProperties.java rename to spring-boot-environment/src/main/java/com/baeldung/properties/ConfProperties.java diff --git a/spring-boot-ops/src/main/java/com/baeldung/properties/ExternalPropertyConfigurer.java b/spring-boot-environment/src/main/java/com/baeldung/properties/ExternalPropertyConfigurer.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/properties/ExternalPropertyConfigurer.java rename to spring-boot-environment/src/main/java/com/baeldung/properties/ExternalPropertyConfigurer.java diff --git a/spring-boot-ops/src/main/java/com/baeldung/properties/ExternalPropertyFileLoader.java b/spring-boot-environment/src/main/java/com/baeldung/properties/ExternalPropertyFileLoader.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/properties/ExternalPropertyFileLoader.java rename to spring-boot-environment/src/main/java/com/baeldung/properties/ExternalPropertyFileLoader.java diff --git a/spring-boot-ops/src/main/resources/META-INF/spring.factories b/spring-boot-environment/src/main/resources/META-INF/spring.factories similarity index 100% rename from spring-boot-ops/src/main/resources/META-INF/spring.factories rename to spring-boot-environment/src/main/resources/META-INF/spring.factories diff --git a/spring-boot-environment/src/main/resources/application.properties b/spring-boot-environment/src/main/resources/application.properties new file mode 100644 index 0000000000..27b7915cff --- /dev/null +++ b/spring-boot-environment/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.main.allow-bean-definition-overriding=true +management.endpoint.shutdown.enabled=true \ No newline at end of file diff --git a/spring-boot-ops/src/main/resources/external/conf.properties b/spring-boot-environment/src/main/resources/external/conf.properties similarity index 100% rename from spring-boot-ops/src/main/resources/external/conf.properties rename to spring-boot-environment/src/main/resources/external/conf.properties diff --git a/spring-boot-environment/src/main/resources/logback.xml b/spring-boot-environment/src/main/resources/logback.xml new file mode 100644 index 0000000000..7d900d8ea8 --- /dev/null +++ b/spring-boot-environment/src/main/resources/logback.xml @@ -0,0 +1,13 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + \ No newline at end of file diff --git a/spring-boot-ops/src/test/java/com/baeldung/environmentpostprocessor/PriceCalculationEnvironmentPostProcessorLiveTest.java b/spring-boot-environment/src/test/java/com/baeldung/environmentpostprocessor/PriceCalculationEnvironmentPostProcessorLiveTest.java similarity index 100% rename from spring-boot-ops/src/test/java/com/baeldung/environmentpostprocessor/PriceCalculationEnvironmentPostProcessorLiveTest.java rename to spring-boot-environment/src/test/java/com/baeldung/environmentpostprocessor/PriceCalculationEnvironmentPostProcessorLiveTest.java diff --git a/spring-boot-ops/src/test/java/com/baeldung/properties/ExternalPropertyFileLoaderIntegrationTest.java b/spring-boot-environment/src/test/java/com/baeldung/properties/ExternalPropertyFileLoaderIntegrationTest.java similarity index 100% rename from spring-boot-ops/src/test/java/com/baeldung/properties/ExternalPropertyFileLoaderIntegrationTest.java rename to spring-boot-environment/src/test/java/com/baeldung/properties/ExternalPropertyFileLoaderIntegrationTest.java diff --git a/spring-boot-management/README.md b/spring-boot-management/README.md deleted file mode 100644 index 53d4c439ff..0000000000 --- a/spring-boot-management/README.md +++ /dev/null @@ -1,7 +0,0 @@ -## Spring Boot Logging HTTP Requests - -This module contains articles about the management of Spring Boot applications. - -### Relevant Articles: -- [Logging HTTP Requests with Spring Boot Actuator HTTP Tracing](https://www.baeldung.com/spring-boot-actuator-http) - diff --git a/spring-boot-management/pom.xml b/spring-boot-management/pom.xml deleted file mode 100644 index ca483d2f61..0000000000 --- a/spring-boot-management/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - 4.0.0 - - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../parent-boot-2 - - com.baeldung - spring-boot-management - 0.0.1-SNAPSHOT - spring-boot-management - - - com.baeldung.spring.boot.management.logging.LoggingApplication - 1.8 - 2.1.6 - - - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-security - - - de.codecentric - spring-boot-admin-starter-client - ${spring-boot-admin-starter-client.version} - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-ops-2/.gitignore b/spring-boot-ops-2/.gitignore deleted file mode 100644 index 153c9335eb..0000000000 --- a/spring-boot-ops-2/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -HELP.md -/target/ -!.mvn/wrapper/maven-wrapper.jar - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ -/build/ - -### VS Code ### -.vscode/ diff --git a/spring-boot-ops-2/README.md b/spring-boot-ops-2/README.md deleted file mode 100644 index 0925b099b1..0000000000 --- a/spring-boot-ops-2/README.md +++ /dev/null @@ -1,9 +0,0 @@ -## Spring Boot Operations - -This module contains articles about Spring Boot Operations - -### Relevant Articles - -- [How to Configure Spring Boot Tomcat](https://www.baeldung.com/spring-boot-configure-tomcat) -- [Spring Boot Embedded Tomcat Logs](https://www.baeldung.com/spring-boot-embedded-tomcat-logs) -- More articles: [[<-- prev]](/spring-boot-ops) diff --git a/spring-boot-ops-2/pom.xml b/spring-boot-ops-2/pom.xml deleted file mode 100644 index 74fcd79169..0000000000 --- a/spring-boot-ops-2/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - 4.0.0 - com.baeldung - spring-boot-ops-2 - 0.0.1-SNAPSHOT - spring-boot-ops-2 - - - parent-boot-2 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-2 - - - - - org.springframework.boot - spring-boot-starter-web - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - diff --git a/spring-boot-ops-2/src/main/resources/application.properties b/spring-boot-ops-2/src/main/resources/application.properties deleted file mode 100644 index fc3fff1d38..0000000000 --- a/spring-boot-ops-2/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -spring.profiles.active=tomcat diff --git a/spring-boot-ops/README.md b/spring-boot-ops/README.md deleted file mode 100644 index 2720bc5ae2..0000000000 --- a/spring-boot-ops/README.md +++ /dev/null @@ -1,20 +0,0 @@ -## Spring Boot Operations - -This module contains articles about Spring Boot Operations - -### Relevant Articles: - - [Deploy a Spring Boot WAR into a Tomcat Server](https://www.baeldung.com/spring-boot-war-tomcat-deploy) - - [Spring Boot Dependency Management with a Custom Parent](https://www.baeldung.com/spring-boot-dependency-management-custom-parent) - - [A Custom Data Binder in Spring MVC](https://www.baeldung.com/spring-mvc-custom-data-binder) - - [Create a Fat Jar App with Spring Boot](https://www.baeldung.com/deployable-fat-jar-spring-boot) - - [Introduction to WebJars](https://www.baeldung.com/maven-webjars) - - [Intro to Spring Boot Starters](https://www.baeldung.com/spring-boot-starters) - - [A Quick Guide to Maven Wrapper](https://www.baeldung.com/maven-wrapper) - - [Shutdown a Spring Boot Application](https://www.baeldung.com/spring-boot-shutdown) - - [Spring Boot Console Application](https://www.baeldung.com/spring-boot-console-app) - - [Comparing Embedded Servlet Containers in Spring Boot](https://www.baeldung.com/spring-boot-servlet-containers) - - [Programmatically Restarting a Spring Boot Application](https://www.baeldung.com/java-restart-spring-boot-app) - - [Spring Properties File Outside jar](https://www.baeldung.com/spring-properties-file-outside-jar) - - [EnvironmentPostProcessor in Spring Boot](https://www.baeldung.com/spring-boot-environmentpostprocessor) - - [Running a Spring Boot App with Maven vs an Executable War/Jar](https://www.baeldung.com/spring-boot-run-maven-vs-executable-jar) - - More articles: [[next -->]](/spring-boot-ops-2) diff --git a/spring-boot-runtime/README.md b/spring-boot-runtime/README.md new file mode 100644 index 0000000000..d3dc19493d --- /dev/null +++ b/spring-boot-runtime/README.md @@ -0,0 +1,10 @@ +## Spring Boot Runtime + +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) + - [How to Disable Console Logging in Spring Boot](https://www.baeldung.com/spring-boot-disable-console-logging) + - [Spring Boot Embedded Tomcat Logs](https://www.baeldung.com/spring-boot-embedded-tomcat-logs) \ No newline at end of file diff --git a/spring-boot-disable-console-logging/disabling-console-jul/.gitignore b/spring-boot-runtime/disabling-console-jul/.gitignore similarity index 100% rename from spring-boot-disable-console-logging/disabling-console-jul/.gitignore rename to spring-boot-runtime/disabling-console-jul/.gitignore diff --git a/spring-boot-disable-console-logging/disabling-console-jul/pom.xml b/spring-boot-runtime/disabling-console-jul/pom.xml similarity index 100% rename from spring-boot-disable-console-logging/disabling-console-jul/pom.xml rename to spring-boot-runtime/disabling-console-jul/pom.xml diff --git a/spring-boot-disable-console-logging/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/DisablingConsoleJulApp.java b/spring-boot-runtime/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/DisablingConsoleJulApp.java similarity index 100% rename from spring-boot-disable-console-logging/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/DisablingConsoleJulApp.java rename to spring-boot-runtime/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/DisablingConsoleJulApp.java diff --git a/spring-boot-disable-console-logging/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/controllers/DisabledConsoleRestController.java b/spring-boot-runtime/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/controllers/DisabledConsoleRestController.java similarity index 100% rename from spring-boot-disable-console-logging/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/controllers/DisabledConsoleRestController.java rename to spring-boot-runtime/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/controllers/DisabledConsoleRestController.java diff --git a/spring-boot-disable-console-logging/disabling-console-jul/src/main/resources/application.properties b/spring-boot-runtime/disabling-console-jul/src/main/resources/application.properties similarity index 100% rename from spring-boot-disable-console-logging/disabling-console-jul/src/main/resources/application.properties rename to spring-boot-runtime/disabling-console-jul/src/main/resources/application.properties diff --git a/spring-boot-disable-console-logging/disabling-console-jul/src/main/resources/logging.properties b/spring-boot-runtime/disabling-console-jul/src/main/resources/logging.properties similarity index 100% rename from spring-boot-disable-console-logging/disabling-console-jul/src/main/resources/logging.properties rename to spring-boot-runtime/disabling-console-jul/src/main/resources/logging.properties diff --git a/spring-boot-disable-console-logging/disabling-console-log4j2/.gitignore b/spring-boot-runtime/disabling-console-log4j2/.gitignore similarity index 100% rename from spring-boot-disable-console-logging/disabling-console-log4j2/.gitignore rename to spring-boot-runtime/disabling-console-log4j2/.gitignore diff --git a/spring-boot-disable-console-logging/disabling-console-log4j2/pom.xml b/spring-boot-runtime/disabling-console-log4j2/pom.xml similarity index 100% rename from spring-boot-disable-console-logging/disabling-console-log4j2/pom.xml rename to spring-boot-runtime/disabling-console-log4j2/pom.xml diff --git a/spring-boot-disable-console-logging/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/DisablingConsoleLog4j2App.java b/spring-boot-runtime/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/DisablingConsoleLog4j2App.java similarity index 100% rename from spring-boot-disable-console-logging/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/DisablingConsoleLog4j2App.java rename to spring-boot-runtime/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/DisablingConsoleLog4j2App.java diff --git a/spring-boot-disable-console-logging/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/controllers/DisabledConsoleRestController.java b/spring-boot-runtime/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/controllers/DisabledConsoleRestController.java similarity index 100% rename from spring-boot-disable-console-logging/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/controllers/DisabledConsoleRestController.java rename to spring-boot-runtime/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/controllers/DisabledConsoleRestController.java diff --git a/spring-boot-disable-console-logging/disabling-console-log4j2/src/main/resources/log4j2.xml b/spring-boot-runtime/disabling-console-log4j2/src/main/resources/log4j2.xml similarity index 100% rename from spring-boot-disable-console-logging/disabling-console-log4j2/src/main/resources/log4j2.xml rename to spring-boot-runtime/disabling-console-log4j2/src/main/resources/log4j2.xml diff --git a/spring-boot-disable-console-logging/disabling-console-logback/.gitignore b/spring-boot-runtime/disabling-console-logback/.gitignore similarity index 100% rename from spring-boot-disable-console-logging/disabling-console-logback/.gitignore rename to spring-boot-runtime/disabling-console-logback/.gitignore diff --git a/spring-boot-disable-console-logging/disabling-console-logback/pom.xml b/spring-boot-runtime/disabling-console-logback/pom.xml similarity index 100% rename from spring-boot-disable-console-logging/disabling-console-logback/pom.xml rename to spring-boot-runtime/disabling-console-logback/pom.xml diff --git a/spring-boot-disable-console-logging/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/DisablingConsoleLogbackApp.java b/spring-boot-runtime/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/DisablingConsoleLogbackApp.java similarity index 100% rename from spring-boot-disable-console-logging/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/DisablingConsoleLogbackApp.java rename to spring-boot-runtime/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/DisablingConsoleLogbackApp.java diff --git a/spring-boot-disable-console-logging/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/controllers/DisabledConsoleRestController.java b/spring-boot-runtime/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/controllers/DisabledConsoleRestController.java similarity index 100% rename from spring-boot-disable-console-logging/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/controllers/DisabledConsoleRestController.java rename to spring-boot-runtime/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/controllers/DisabledConsoleRestController.java diff --git a/spring-boot-disable-console-logging/disabling-console-logback/src/main/resources/application.properties b/spring-boot-runtime/disabling-console-logback/src/main/resources/application.properties similarity index 100% rename from spring-boot-disable-console-logging/disabling-console-logback/src/main/resources/application.properties rename to spring-boot-runtime/disabling-console-logback/src/main/resources/application.properties diff --git a/spring-boot-disable-console-logging/disabling-console-logback/src/main/resources/logback-spring.xml b/spring-boot-runtime/disabling-console-logback/src/main/resources/logback-spring.xml similarity index 100% rename from spring-boot-disable-console-logging/disabling-console-logback/src/main/resources/logback-spring.xml rename to spring-boot-runtime/disabling-console-logback/src/main/resources/logback-spring.xml diff --git a/spring-boot-ops/docker/Dockerfile b/spring-boot-runtime/docker/Dockerfile similarity index 100% rename from spring-boot-ops/docker/Dockerfile rename to spring-boot-runtime/docker/Dockerfile diff --git a/spring-boot-ops/docker/logback.xml b/spring-boot-runtime/docker/logback.xml similarity index 100% rename from spring-boot-ops/docker/logback.xml rename to spring-boot-runtime/docker/logback.xml diff --git a/spring-boot-ops/docker/run.sh b/spring-boot-runtime/docker/run.sh old mode 100755 new mode 100644 similarity index 100% rename from spring-boot-ops/docker/run.sh rename to spring-boot-runtime/docker/run.sh diff --git a/spring-boot-runtime/pom.xml b/spring-boot-runtime/pom.xml new file mode 100644 index 0000000000..dca9b47410 --- /dev/null +++ b/spring-boot-runtime/pom.xml @@ -0,0 +1,159 @@ + + + 4.0.0 + spring-boot-runtime + spring-boot-runtime + war + Demo project for Spring Boot + + + parent-boot-2 + com.baeldung + 0.0.1-SNAPSHOT + ../parent-boot-2 + + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-thymeleaf + provided + + + + org.springframework.boot + spring-boot-starter-test + test + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + + org.springframework.boot + spring-boot-starter-mail + + + + org.springframework.boot + spring-boot-starter-actuator + + + + org.springframework.boot + spring-boot-starter-security + + + de.codecentric + spring-boot-admin-starter-client + ${spring-boot-admin-starter-client.version} + + + + com.h2database + h2 + runtime + + + + javax.persistence + javax.persistence-api + ${jpa.version} + + + + com.google.guava + guava + ${guava.version} + + + + org.subethamail + subethasmtp + ${subethasmtp.version} + test + + + + org.springframework.cloud + spring-cloud-context + ${springcloud.version} + + + + org.apache.httpcomponents + httpclient + ${httpclient.version} + + + + + + ${project.artifactId} + + + src/main/resources + true + + **/conf.properties + + + + + + + + autoconfiguration + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration-test + + test + + + + **/*LiveTest.java + **/*IntegrationTest.java + **/*IntTest.java + + + **/AutoconfigurationTest.java + + + + + + + json + + + + + + + + + + 2.2 + 18.0 + 3.1.7 + 2.0.2.RELEASE + 4.5.8 + 2.1.6 + + + diff --git a/spring-boot-ops/src/main/java/com/baeldung/restart/Application.java b/spring-boot-runtime/src/main/java/com/baeldung/restart/Application.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/restart/Application.java rename to spring-boot-runtime/src/main/java/com/baeldung/restart/Application.java diff --git a/spring-boot-ops/src/main/java/com/baeldung/restart/RestartController.java b/spring-boot-runtime/src/main/java/com/baeldung/restart/RestartController.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/restart/RestartController.java rename to spring-boot-runtime/src/main/java/com/baeldung/restart/RestartController.java diff --git a/spring-boot-ops/src/main/java/com/baeldung/restart/RestartService.java b/spring-boot-runtime/src/main/java/com/baeldung/restart/RestartService.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/restart/RestartService.java rename to spring-boot-runtime/src/main/java/com/baeldung/restart/RestartService.java diff --git a/spring-boot-ops/src/main/java/com/baeldung/shutdown/Application.java b/spring-boot-runtime/src/main/java/com/baeldung/shutdown/Application.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/shutdown/Application.java rename to spring-boot-runtime/src/main/java/com/baeldung/shutdown/Application.java diff --git a/spring-boot-ops/src/main/java/com/baeldung/shutdown/ShutdownConfig.java b/spring-boot-runtime/src/main/java/com/baeldung/shutdown/ShutdownConfig.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/shutdown/ShutdownConfig.java rename to spring-boot-runtime/src/main/java/com/baeldung/shutdown/ShutdownConfig.java diff --git a/spring-boot-ops/src/main/java/com/baeldung/shutdown/TerminateBean.java b/spring-boot-runtime/src/main/java/com/baeldung/shutdown/TerminateBean.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/shutdown/TerminateBean.java rename to spring-boot-runtime/src/main/java/com/baeldung/shutdown/TerminateBean.java diff --git a/spring-boot-ops/src/main/java/com/baeldung/shutdown/shutdown/ShutdownController.java b/spring-boot-runtime/src/main/java/com/baeldung/shutdown/shutdown/ShutdownController.java similarity index 100% rename from spring-boot-ops/src/main/java/com/baeldung/shutdown/shutdown/ShutdownController.java rename to spring-boot-runtime/src/main/java/com/baeldung/shutdown/shutdown/ShutdownController.java diff --git a/spring-boot-management/src/main/java/com/baeldung/spring/boot/management/logging/LoggingApplication.java b/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/logging/LoggingApplication.java similarity index 82% rename from spring-boot-management/src/main/java/com/baeldung/spring/boot/management/logging/LoggingApplication.java rename to spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/logging/LoggingApplication.java index 6371ac4c64..5c1b143c4e 100644 --- a/spring-boot-management/src/main/java/com/baeldung/spring/boot/management/logging/LoggingApplication.java +++ b/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/logging/LoggingApplication.java @@ -2,7 +2,9 @@ package com.baeldung.spring.boot.management.logging; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Profile; +@Profile("logging") @SpringBootApplication public class LoggingApplication { public static void main(String[] args) { diff --git a/spring-boot-management/src/main/java/com/baeldung/spring/boot/management/logging/LoggingController.java b/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/logging/LoggingController.java similarity index 100% rename from spring-boot-management/src/main/java/com/baeldung/spring/boot/management/logging/LoggingController.java rename to spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/logging/LoggingController.java diff --git a/spring-boot-management/src/main/java/com/baeldung/spring/boot/management/logging/SecurityConfig.java b/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/logging/SecurityConfig.java similarity index 100% rename from spring-boot-management/src/main/java/com/baeldung/spring/boot/management/logging/SecurityConfig.java rename to spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/logging/SecurityConfig.java diff --git a/spring-boot-management/src/main/java/com/baeldung/spring/boot/management/trace/App.java b/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/App.java similarity index 80% rename from spring-boot-management/src/main/java/com/baeldung/spring/boot/management/trace/App.java rename to spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/App.java index 150e451c57..ffc30e9b33 100644 --- a/spring-boot-management/src/main/java/com/baeldung/spring/boot/management/trace/App.java +++ b/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/App.java @@ -2,7 +2,9 @@ package com.baeldung.spring.boot.management.trace; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Profile; +@Profile("logging") @SpringBootApplication public class App { diff --git a/spring-boot-management/src/main/java/com/baeldung/spring/boot/management/trace/CustomTraceRepository.java b/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/CustomTraceRepository.java similarity index 100% rename from spring-boot-management/src/main/java/com/baeldung/spring/boot/management/trace/CustomTraceRepository.java rename to spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/CustomTraceRepository.java diff --git a/spring-boot-management/src/main/java/com/baeldung/spring/boot/management/trace/EchoController.java b/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/EchoController.java similarity index 100% rename from spring-boot-management/src/main/java/com/baeldung/spring/boot/management/trace/EchoController.java rename to spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/EchoController.java diff --git a/spring-boot-management/src/main/java/com/baeldung/spring/boot/management/trace/TraceRequestFilter.java b/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/TraceRequestFilter.java similarity index 100% rename from spring-boot-management/src/main/java/com/baeldung/spring/boot/management/trace/TraceRequestFilter.java rename to spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/TraceRequestFilter.java diff --git a/spring-boot-management/src/main/resources/application.properties b/spring-boot-runtime/src/main/resources/application-logging.properties similarity index 100% rename from spring-boot-management/src/main/resources/application.properties rename to spring-boot-runtime/src/main/resources/application-logging.properties diff --git a/spring-boot-ops-2/src/main/resources/application-tomcat.properties b/spring-boot-runtime/src/main/resources/application-tomcat.properties similarity index 100% rename from spring-boot-ops-2/src/main/resources/application-tomcat.properties rename to spring-boot-runtime/src/main/resources/application-tomcat.properties diff --git a/spring-boot-runtime/src/main/resources/application.properties b/spring-boot-runtime/src/main/resources/application.properties new file mode 100644 index 0000000000..27b7915cff --- /dev/null +++ b/spring-boot-runtime/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.main.allow-bean-definition-overriding=true +management.endpoint.shutdown.enabled=true \ No newline at end of file diff --git a/spring-boot-runtime/src/main/resources/logback.xml b/spring-boot-runtime/src/main/resources/logback.xml new file mode 100644 index 0000000000..7d900d8ea8 --- /dev/null +++ b/spring-boot-runtime/src/main/resources/logback.xml @@ -0,0 +1,13 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + \ No newline at end of file diff --git a/spring-boot-ops/src/test/java/com/baeldung/restart/RestartApplicationManualTest.java b/spring-boot-runtime/src/test/java/com/baeldung/restart/RestartApplicationManualTest.java similarity index 100% rename from spring-boot-ops/src/test/java/com/baeldung/restart/RestartApplicationManualTest.java rename to spring-boot-runtime/src/test/java/com/baeldung/restart/RestartApplicationManualTest.java diff --git a/spring-boot-ops/src/test/java/com/baeldung/shutdown/ShutdownApplicationIntegrationTest.java b/spring-boot-runtime/src/test/java/com/baeldung/shutdown/ShutdownApplicationIntegrationTest.java similarity index 100% rename from spring-boot-ops/src/test/java/com/baeldung/shutdown/ShutdownApplicationIntegrationTest.java rename to spring-boot-runtime/src/test/java/com/baeldung/shutdown/ShutdownApplicationIntegrationTest.java diff --git a/spring-boot-ops/src/test/resources/application-integrationtest.properties b/spring-boot-runtime/src/test/resources/application-integrationtest.properties similarity index 100% rename from spring-boot-ops/src/test/resources/application-integrationtest.properties rename to spring-boot-runtime/src/test/resources/application-integrationtest.properties diff --git a/spring-boot-ops/src/test/resources/application.properties b/spring-boot-runtime/src/test/resources/application.properties similarity index 100% rename from spring-boot-ops/src/test/resources/application.properties rename to spring-boot-runtime/src/test/resources/application.properties diff --git a/spring-mvc-simple-2/README.md b/spring-mvc-simple-2/README.md index 80456c5732..a4a545ab72 100644 --- a/spring-mvc-simple-2/README.md +++ b/spring-mvc-simple-2/README.md @@ -4,4 +4,5 @@ This module contains articles about Spring MVC ## Relevant articles: - [How to Read HTTP Headers in Spring REST Controllers](https://www.baeldung.com/spring-rest-http-headers) +- [A Custom Data Binder in Spring MVC](https://www.baeldung.com/spring-mvc-custom-data-binder) - More articles: [[<-- prev]](/spring-mvc-simple) diff --git a/spring-mvc-simple-2/pom.xml b/spring-mvc-simple-2/pom.xml index ca911b2719..7faa832552 100644 --- a/spring-mvc-simple-2/pom.xml +++ b/spring-mvc-simple-2/pom.xml @@ -1,42 +1,151 @@ - - + + 4.0.0 spring-mvc-simple-2 - war spring-mvc-simple-2 + war + Demo project for Spring Boot - com.baeldung parent-boot-2 + com.baeldung 0.0.1-SNAPSHOT ../parent-boot-2 + org.springframework.boot spring-boot-starter-web + org.springframework.boot spring-boot-starter-test test + + + org.springframework.boot + spring-boot-starter-thymeleaf + provided + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + + org.springframework.boot + spring-boot-starter-mail + + + + org.springframework.boot + spring-boot-starter-actuator + + + + com.h2database + h2 + runtime + + + + javax.persistence + javax.persistence-api + ${jpa.version} + + + + com.google.guava + guava + ${guava.version} + + + + org.subethamail + subethasmtp + ${subethasmtp.version} + test + + + + org.springframework.cloud + spring-cloud-context + ${springcloud.version} + + + + org.apache.httpcomponents + httpclient + ${httpclient.version} + + + ${project.artifactId} + + + src/main/resources + true + + **/conf.properties + + + + + + + + autoconfiguration + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration-test + + test + + + + **/*LiveTest.java + **/*IntegrationTest.java + **/*IntTest.java + + + **/AutoconfigurationTest.java + + + + + + + json + + + + + + + + - 1.8 - 1.8 + + org.baeldung.boot.Application + 3.1.1 + 3.3.7-1 + 2.2 + 18.0 + 3.1.7 + 2.0.2.RELEASE + 4.5.8 - - - - org.apache.maven.plugins - maven-war-plugin - - - spring-mvc-simple2 - diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/Application.java b/spring-mvc-simple-2/src/main/java/org/baeldung/boot/Application.java similarity index 100% rename from spring-boot-ops/src/main/java/org/baeldung/boot/Application.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/boot/Application.java diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/config/WebConfig.java b/spring-mvc-simple-2/src/main/java/org/baeldung/boot/config/WebConfig.java similarity index 100% rename from spring-boot-ops/src/main/java/org/baeldung/boot/config/WebConfig.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/boot/config/WebConfig.java diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/controller/GenericEntityController.java b/spring-mvc-simple-2/src/main/java/org/baeldung/boot/controller/GenericEntityController.java similarity index 100% rename from spring-boot-ops/src/main/java/org/baeldung/boot/controller/GenericEntityController.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/boot/controller/GenericEntityController.java diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/converter/GenericBigDecimalConverter.java b/spring-mvc-simple-2/src/main/java/org/baeldung/boot/converter/GenericBigDecimalConverter.java similarity index 100% rename from spring-boot-ops/src/main/java/org/baeldung/boot/converter/GenericBigDecimalConverter.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/boot/converter/GenericBigDecimalConverter.java diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToAbstractEntityConverterFactory.java b/spring-mvc-simple-2/src/main/java/org/baeldung/boot/converter/StringToAbstractEntityConverterFactory.java similarity index 100% rename from spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToAbstractEntityConverterFactory.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/boot/converter/StringToAbstractEntityConverterFactory.java diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToEmployeeConverter.java b/spring-mvc-simple-2/src/main/java/org/baeldung/boot/converter/StringToEmployeeConverter.java similarity index 100% rename from spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToEmployeeConverter.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/boot/converter/StringToEmployeeConverter.java diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToEnumConverter.java b/spring-mvc-simple-2/src/main/java/org/baeldung/boot/converter/StringToEnumConverter.java similarity index 100% rename from spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToEnumConverter.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/boot/converter/StringToEnumConverter.java diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToLocalDateTimeConverter.java b/spring-mvc-simple-2/src/main/java/org/baeldung/boot/converter/StringToLocalDateTimeConverter.java similarity index 100% rename from spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToLocalDateTimeConverter.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/boot/converter/StringToLocalDateTimeConverter.java diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/converter/controller/AbstractEntityController.java b/spring-mvc-simple-2/src/main/java/org/baeldung/boot/converter/controller/AbstractEntityController.java similarity index 100% rename from spring-boot-ops/src/main/java/org/baeldung/boot/converter/controller/AbstractEntityController.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/boot/converter/controller/AbstractEntityController.java diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/converter/controller/StringToEmployeeConverterController.java b/spring-mvc-simple-2/src/main/java/org/baeldung/boot/converter/controller/StringToEmployeeConverterController.java similarity index 100% rename from spring-boot-ops/src/main/java/org/baeldung/boot/converter/controller/StringToEmployeeConverterController.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/boot/converter/controller/StringToEmployeeConverterController.java diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/domain/AbstractEntity.java b/spring-mvc-simple-2/src/main/java/org/baeldung/boot/domain/AbstractEntity.java similarity index 100% rename from spring-boot-ops/src/main/java/org/baeldung/boot/domain/AbstractEntity.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/boot/domain/AbstractEntity.java diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/domain/Bar.java b/spring-mvc-simple-2/src/main/java/org/baeldung/boot/domain/Bar.java similarity index 100% rename from spring-boot-ops/src/main/java/org/baeldung/boot/domain/Bar.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/boot/domain/Bar.java diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/domain/Employee.java b/spring-mvc-simple-2/src/main/java/org/baeldung/boot/domain/Employee.java similarity index 100% rename from spring-boot-ops/src/main/java/org/baeldung/boot/domain/Employee.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/boot/domain/Employee.java diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/domain/Foo.java b/spring-mvc-simple-2/src/main/java/org/baeldung/boot/domain/Foo.java similarity index 100% rename from spring-boot-ops/src/main/java/org/baeldung/boot/domain/Foo.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/boot/domain/Foo.java diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/domain/GenericEntity.java b/spring-mvc-simple-2/src/main/java/org/baeldung/boot/domain/GenericEntity.java similarity index 100% rename from spring-boot-ops/src/main/java/org/baeldung/boot/domain/GenericEntity.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/boot/domain/GenericEntity.java diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/domain/Modes.java b/spring-mvc-simple-2/src/main/java/org/baeldung/boot/domain/Modes.java similarity index 100% rename from spring-boot-ops/src/main/java/org/baeldung/boot/domain/Modes.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/boot/domain/Modes.java diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/repository/GenericEntityRepository.java b/spring-mvc-simple-2/src/main/java/org/baeldung/boot/repository/GenericEntityRepository.java similarity index 100% rename from spring-boot-ops/src/main/java/org/baeldung/boot/repository/GenericEntityRepository.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/boot/repository/GenericEntityRepository.java diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/web/resolver/HeaderVersionArgumentResolver.java b/spring-mvc-simple-2/src/main/java/org/baeldung/boot/web/resolver/HeaderVersionArgumentResolver.java similarity index 100% rename from spring-boot-ops/src/main/java/org/baeldung/boot/web/resolver/HeaderVersionArgumentResolver.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/boot/web/resolver/HeaderVersionArgumentResolver.java diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/web/resolver/Version.java b/spring-mvc-simple-2/src/main/java/org/baeldung/boot/web/resolver/Version.java similarity index 100% rename from spring-boot-ops/src/main/java/org/baeldung/boot/web/resolver/Version.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/boot/web/resolver/Version.java diff --git a/spring-mvc-simple-2/src/main/resources/application.properties b/spring-mvc-simple-2/src/main/resources/application.properties new file mode 100644 index 0000000000..709574239b --- /dev/null +++ b/spring-mvc-simple-2/src/main/resources/application.properties @@ -0,0 +1 @@ +spring.main.allow-bean-definition-overriding=true \ No newline at end of file diff --git a/spring-boot-ops/src/test/java/org/baeldung/SpringBootApplicationIntegrationTest.java b/spring-mvc-simple-2/src/test/java/com/baeldung/SpringBootApplicationIntegrationTest.java similarity index 99% rename from spring-boot-ops/src/test/java/org/baeldung/SpringBootApplicationIntegrationTest.java rename to spring-mvc-simple-2/src/test/java/com/baeldung/SpringBootApplicationIntegrationTest.java index 5627543b62..7190c4f427 100644 --- a/spring-boot-ops/src/test/java/org/baeldung/SpringBootApplicationIntegrationTest.java +++ b/spring-mvc-simple-2/src/test/java/com/baeldung/SpringBootApplicationIntegrationTest.java @@ -1,4 +1,4 @@ -package org.baeldung; +package com.baeldung; import org.baeldung.boot.Application; import org.baeldung.boot.domain.Modes; diff --git a/spring-boot-ops/src/test/java/org/baeldung/SpringBootJPAIntegrationTest.java b/spring-mvc-simple-2/src/test/java/com/baeldung/SpringBootJPAIntegrationTest.java similarity index 98% rename from spring-boot-ops/src/test/java/org/baeldung/SpringBootJPAIntegrationTest.java rename to spring-mvc-simple-2/src/test/java/com/baeldung/SpringBootJPAIntegrationTest.java index c368cf5219..c283529435 100644 --- a/spring-boot-ops/src/test/java/org/baeldung/SpringBootJPAIntegrationTest.java +++ b/spring-mvc-simple-2/src/test/java/com/baeldung/SpringBootJPAIntegrationTest.java @@ -1,4 +1,4 @@ -package org.baeldung; +package com.baeldung; import org.baeldung.boot.Application; import org.baeldung.boot.domain.GenericEntity; diff --git a/spring-boot-ops/src/test/java/org/baeldung/SpringBootMailIntegrationTest.java b/spring-mvc-simple-2/src/test/java/com/baeldung/SpringBootMailIntegrationTest.java similarity index 99% rename from spring-boot-ops/src/test/java/org/baeldung/SpringBootMailIntegrationTest.java rename to spring-mvc-simple-2/src/test/java/com/baeldung/SpringBootMailIntegrationTest.java index a6a84184fa..1a2a4e22d9 100644 --- a/spring-boot-ops/src/test/java/org/baeldung/SpringBootMailIntegrationTest.java +++ b/spring-mvc-simple-2/src/test/java/com/baeldung/SpringBootMailIntegrationTest.java @@ -1,4 +1,4 @@ -package org.baeldung; +package com.baeldung; import org.baeldung.boot.Application; import org.junit.After;