From ed92f5579de3caa6cf391262a95272d466d76f0d Mon Sep 17 00:00:00 2001 From: amit2103 Date: Fri, 27 Sep 2019 01:07:06 +0530 Subject: [PATCH] [BAEL-17473] - Initial commit --- spring-boot-artifacts/README.md | 7 + .../pom.xml | 4 +- .../baeldung/properties/ConfProperties.java | 0 .../ExternalPropertyConfigurer.java | 0 .../ExternalPropertyFileLoader.java | 0 .../com/baeldung/webjar/TestController.java | 0 .../webjar/WebjarsdemoApplication.java | 0 .../src/main/resources/application.properties | 1 + .../main/resources/external/conf.properties | 0 .../src/main/resources/logback.xml | 0 .../src/main/resources/templates/index.html | 0 ...rnalPropertyFileLoaderIntegrationTest.java | 0 ...WebjarsdemoApplicationIntegrationTest.java | 0 spring-boot-deployment/README.md | 5 + spring-boot-deployment/pom.xml | 203 ++++++++++++++++++ .../SpringBootConfigurationApplication.java | 0 .../controller/GreetingsController.java | 0 .../SpringBootConsoleApplication.java | 0 .../SpringBootTomcatApplication.java | 0 .../springbootsimple/TomcatController.java | 0 .../resources/application-tomcat.properties | 0 .../src/main/resources/application.properties | 1 + .../src/main/resources/logback.xml | 10 +- .../SpringContextIntegrationTest.java | 0 .../SpringContextTest.java | 0 ...gBootTomcatApplicationIntegrationTest.java | 0 spring-boot-environment/README.md | 2 + spring-boot-environment/pom.xml | 148 +++++++++++++ .../PriceCalculationApplication.java | 0 ...ceCalculationEnvironmentPostProcessor.java | 0 .../PriceCalculationAutoConfig.java | 0 .../calculator/GrossPriceCalculator.java | 0 .../calculator/NetPriceCalculator.java | 0 .../calculator/PriceCalculator.java | 0 .../service/PriceCalculationService.java | 0 .../main/resources/META-INF/spring.factories | 0 .../src/main/resources/application.properties | 0 .../src/main/resources/logback.xml | 13 ++ ...ationEnvironmentPostProcessorLiveTest.java | 0 spring-boot-management/pom.xml | 56 ----- spring-boot-ops-2/.gitignore | 29 --- spring-boot-ops-2/README.MD | 4 - spring-boot-ops-2/pom.xml | 40 ---- .../src/main/resources/application.properties | 1 - spring-boot-ops/README.md | 14 -- spring-boot-runtime/README.md | 5 + .../docker/Dockerfile | 0 .../docker/logback.xml | 0 .../docker/run.sh | 0 spring-boot-runtime/pom.xml | 159 ++++++++++++++ .../compare/ComparisonApplication.java | 0 .../baeldung/compare/StartupEventHandler.java | 0 .../com/baeldung/restart/Application.java | 0 .../baeldung/restart/RestartController.java | 0 .../com/baeldung/restart/RestartService.java | 0 .../com/baeldung/shutdown/Application.java | 0 .../com/baeldung/shutdown/ShutdownConfig.java | 0 .../com/baeldung/shutdown/TerminateBean.java | 0 .../shutdown/shutdown/ShutdownController.java | 0 .../logging/LoggingApplication.java | 2 + .../management/logging/LoggingController.java | 0 .../management/logging/SecurityConfig.java | 0 .../spring/boot/management/trace/App.java | 2 + .../trace/CustomTraceRepository.java | 0 .../boot/management/trace/EchoController.java | 0 .../management/trace/TraceRequestFilter.java | 0 .../resources/application-logging.properties | 0 .../src/main/resources/application.properties | 7 + .../src/main/resources/logback.xml | 13 ++ .../restart/RestartApplicationManualTest.java | 0 .../ShutdownApplicationIntegrationTest.java | 0 .../application-integrationtest.properties | 0 .../src/test/resources/application.properties | 0 spring-mvc-simple-2/README.md | 1 + spring-mvc-simple-2/pom.xml | 147 +++++++++++-- .../java/org/baeldung/boot/Application.java | 0 .../org/baeldung/boot/config/WebConfig.java | 0 .../controller/GenericEntityController.java | 0 .../converter/GenericBigDecimalConverter.java | 0 ...tringToAbstractEntityConverterFactory.java | 0 .../converter/StringToEmployeeConverter.java | 0 .../boot/converter/StringToEnumConverter.java | 0 .../StringToLocalDateTimeConverter.java | 0 .../controller/AbstractEntityController.java | 0 .../StringToEmployeeConverterController.java | 0 .../baeldung/boot/domain/AbstractEntity.java | 0 .../java/org/baeldung/boot/domain/Bar.java | 0 .../org/baeldung/boot/domain/Employee.java | 0 .../java/org/baeldung/boot/domain/Foo.java | 0 .../baeldung/boot/domain/GenericEntity.java | 0 .../java/org/baeldung/boot/domain/Modes.java | 0 .../repository/GenericEntityRepository.java | 0 .../HeaderVersionArgumentResolver.java | 0 .../baeldung/boot/web/resolver/Version.java | 0 .../SpringBootApplicationIntegrationTest.java | 2 +- .../SpringBootJPAIntegrationTest.java | 2 +- .../SpringBootMailIntegrationTest.java | 2 +- 97 files changed, 710 insertions(+), 170 deletions(-) create mode 100644 spring-boot-artifacts/README.md rename {spring-boot-ops => spring-boot-artifacts}/pom.xml (98%) rename {spring-boot-ops => spring-boot-artifacts}/src/main/java/com/baeldung/properties/ConfProperties.java (100%) rename {spring-boot-ops => spring-boot-artifacts}/src/main/java/com/baeldung/properties/ExternalPropertyConfigurer.java (100%) rename {spring-boot-ops => spring-boot-artifacts}/src/main/java/com/baeldung/properties/ExternalPropertyFileLoader.java (100%) rename {spring-boot-ops => spring-boot-artifacts}/src/main/java/com/baeldung/webjar/TestController.java (100%) rename {spring-boot-ops => spring-boot-artifacts}/src/main/java/com/baeldung/webjar/WebjarsdemoApplication.java (100%) create mode 100644 spring-boot-artifacts/src/main/resources/application.properties rename {spring-boot-ops => spring-boot-artifacts}/src/main/resources/external/conf.properties (100%) rename {spring-boot-ops => spring-boot-artifacts}/src/main/resources/logback.xml (100%) rename {spring-boot-ops => spring-boot-artifacts}/src/main/resources/templates/index.html (100%) rename {spring-boot-ops => spring-boot-artifacts}/src/test/java/com/baeldung/properties/ExternalPropertyFileLoaderIntegrationTest.java (100%) rename {spring-boot-ops => spring-boot-artifacts}/src/test/java/com/baeldung/webjar/WebjarsdemoApplicationIntegrationTest.java (100%) create mode 100644 spring-boot-deployment/README.md create mode 100644 spring-boot-deployment/pom.xml rename {spring-boot-ops-2 => spring-boot-deployment}/src/main/java/com/baeldung/springbootconfiguration/SpringBootConfigurationApplication.java (100%) rename {spring-boot-ops-2 => spring-boot-deployment}/src/main/java/com/baeldung/springbootconfiguration/controller/GreetingsController.java (100%) rename {spring-boot-ops => spring-boot-deployment}/src/main/java/com/baeldung/springbootnonwebapp/SpringBootConsoleApplication.java (100%) rename {spring-boot-ops => spring-boot-deployment}/src/main/java/com/baeldung/springbootsimple/SpringBootTomcatApplication.java (100%) rename {spring-boot-ops => spring-boot-deployment}/src/main/java/com/baeldung/springbootsimple/TomcatController.java (100%) rename {spring-boot-ops-2 => spring-boot-deployment}/src/main/resources/application-tomcat.properties (100%) create mode 100644 spring-boot-deployment/src/main/resources/application.properties rename {spring-boot-management => spring-boot-deployment}/src/main/resources/logback.xml (55%) rename {spring-boot-ops-2 => spring-boot-deployment}/src/test/java/com/baeldung/springbootconfiguration/SpringContextIntegrationTest.java (100%) rename {spring-boot-ops-2 => spring-boot-deployment}/src/test/java/com/baeldung/springbootconfiguration/SpringContextTest.java (100%) rename {spring-boot-ops => spring-boot-deployment}/src/test/java/com/baeldung/springbootsimple/SpringBootTomcatApplicationIntegrationTest.java (100%) create mode 100644 spring-boot-environment/README.md create mode 100644 spring-boot-environment/pom.xml rename {spring-boot-ops => spring-boot-environment}/src/main/java/com/baeldung/environmentpostprocessor/PriceCalculationApplication.java (100%) rename {spring-boot-ops => spring-boot-environment}/src/main/java/com/baeldung/environmentpostprocessor/PriceCalculationEnvironmentPostProcessor.java (100%) rename {spring-boot-ops => spring-boot-environment}/src/main/java/com/baeldung/environmentpostprocessor/autoconfig/PriceCalculationAutoConfig.java (100%) rename {spring-boot-ops => spring-boot-environment}/src/main/java/com/baeldung/environmentpostprocessor/calculator/GrossPriceCalculator.java (100%) rename {spring-boot-ops => spring-boot-environment}/src/main/java/com/baeldung/environmentpostprocessor/calculator/NetPriceCalculator.java (100%) rename {spring-boot-ops => spring-boot-environment}/src/main/java/com/baeldung/environmentpostprocessor/calculator/PriceCalculator.java (100%) rename {spring-boot-ops => spring-boot-environment}/src/main/java/com/baeldung/environmentpostprocessor/service/PriceCalculationService.java (100%) rename {spring-boot-ops => spring-boot-environment}/src/main/resources/META-INF/spring.factories (100%) rename {spring-boot-ops => spring-boot-environment}/src/main/resources/application.properties (100%) create mode 100644 spring-boot-environment/src/main/resources/logback.xml rename {spring-boot-ops => spring-boot-environment}/src/test/java/com/baeldung/environmentpostprocessor/PriceCalculationEnvironmentPostProcessorLiveTest.java (100%) delete mode 100644 spring-boot-management/pom.xml delete mode 100644 spring-boot-ops-2/.gitignore delete mode 100644 spring-boot-ops-2/README.MD delete mode 100644 spring-boot-ops-2/pom.xml delete mode 100644 spring-boot-ops-2/src/main/resources/application.properties delete mode 100644 spring-boot-ops/README.md create mode 100644 spring-boot-runtime/README.md rename {spring-boot-ops => spring-boot-runtime}/docker/Dockerfile (100%) rename {spring-boot-ops => spring-boot-runtime}/docker/logback.xml (100%) rename {spring-boot-ops => spring-boot-runtime}/docker/run.sh (100%) mode change 100755 => 100644 create mode 100644 spring-boot-runtime/pom.xml rename {spring-boot-ops => spring-boot-runtime}/src/main/java/com/baeldung/compare/ComparisonApplication.java (100%) rename {spring-boot-ops => spring-boot-runtime}/src/main/java/com/baeldung/compare/StartupEventHandler.java (100%) rename {spring-boot-ops => spring-boot-runtime}/src/main/java/com/baeldung/restart/Application.java (100%) rename {spring-boot-ops => spring-boot-runtime}/src/main/java/com/baeldung/restart/RestartController.java (100%) rename {spring-boot-ops => spring-boot-runtime}/src/main/java/com/baeldung/restart/RestartService.java (100%) rename {spring-boot-ops => spring-boot-runtime}/src/main/java/com/baeldung/shutdown/Application.java (100%) rename {spring-boot-ops => spring-boot-runtime}/src/main/java/com/baeldung/shutdown/ShutdownConfig.java (100%) rename {spring-boot-ops => spring-boot-runtime}/src/main/java/com/baeldung/shutdown/TerminateBean.java (100%) rename {spring-boot-ops => spring-boot-runtime}/src/main/java/com/baeldung/shutdown/shutdown/ShutdownController.java (100%) rename {spring-boot-management => spring-boot-runtime}/src/main/java/com/baeldung/spring/boot/management/logging/LoggingApplication.java (82%) rename {spring-boot-management => spring-boot-runtime}/src/main/java/com/baeldung/spring/boot/management/logging/LoggingController.java (100%) rename {spring-boot-management => spring-boot-runtime}/src/main/java/com/baeldung/spring/boot/management/logging/SecurityConfig.java (100%) rename {spring-boot-management => spring-boot-runtime}/src/main/java/com/baeldung/spring/boot/management/trace/App.java (80%) rename {spring-boot-management => spring-boot-runtime}/src/main/java/com/baeldung/spring/boot/management/trace/CustomTraceRepository.java (100%) rename {spring-boot-management => spring-boot-runtime}/src/main/java/com/baeldung/spring/boot/management/trace/EchoController.java (100%) rename {spring-boot-management => spring-boot-runtime}/src/main/java/com/baeldung/spring/boot/management/trace/TraceRequestFilter.java (100%) rename spring-boot-management/src/main/resources/application.properties => spring-boot-runtime/src/main/resources/application-logging.properties (100%) create mode 100644 spring-boot-runtime/src/main/resources/application.properties create mode 100644 spring-boot-runtime/src/main/resources/logback.xml rename {spring-boot-ops => spring-boot-runtime}/src/test/java/com/baeldung/restart/RestartApplicationManualTest.java (100%) rename {spring-boot-ops => spring-boot-runtime}/src/test/java/com/baeldung/shutdown/ShutdownApplicationIntegrationTest.java (100%) rename {spring-boot-ops => spring-boot-runtime}/src/test/resources/application-integrationtest.properties (100%) rename {spring-boot-ops => spring-boot-runtime}/src/test/resources/application.properties (100%) rename {spring-boot-ops => spring-mvc-simple-2}/src/main/java/org/baeldung/boot/Application.java (100%) rename {spring-boot-ops => spring-mvc-simple-2}/src/main/java/org/baeldung/boot/config/WebConfig.java (100%) rename {spring-boot-ops => spring-mvc-simple-2}/src/main/java/org/baeldung/boot/controller/GenericEntityController.java (100%) rename {spring-boot-ops => spring-mvc-simple-2}/src/main/java/org/baeldung/boot/converter/GenericBigDecimalConverter.java (100%) rename {spring-boot-ops => spring-mvc-simple-2}/src/main/java/org/baeldung/boot/converter/StringToAbstractEntityConverterFactory.java (100%) rename {spring-boot-ops => spring-mvc-simple-2}/src/main/java/org/baeldung/boot/converter/StringToEmployeeConverter.java (100%) rename {spring-boot-ops => spring-mvc-simple-2}/src/main/java/org/baeldung/boot/converter/StringToEnumConverter.java (100%) rename {spring-boot-ops => spring-mvc-simple-2}/src/main/java/org/baeldung/boot/converter/StringToLocalDateTimeConverter.java (100%) rename {spring-boot-ops => spring-mvc-simple-2}/src/main/java/org/baeldung/boot/converter/controller/AbstractEntityController.java (100%) rename {spring-boot-ops => spring-mvc-simple-2}/src/main/java/org/baeldung/boot/converter/controller/StringToEmployeeConverterController.java (100%) rename {spring-boot-ops => spring-mvc-simple-2}/src/main/java/org/baeldung/boot/domain/AbstractEntity.java (100%) rename {spring-boot-ops => spring-mvc-simple-2}/src/main/java/org/baeldung/boot/domain/Bar.java (100%) rename {spring-boot-ops => spring-mvc-simple-2}/src/main/java/org/baeldung/boot/domain/Employee.java (100%) rename {spring-boot-ops => spring-mvc-simple-2}/src/main/java/org/baeldung/boot/domain/Foo.java (100%) rename {spring-boot-ops => spring-mvc-simple-2}/src/main/java/org/baeldung/boot/domain/GenericEntity.java (100%) rename {spring-boot-ops => spring-mvc-simple-2}/src/main/java/org/baeldung/boot/domain/Modes.java (100%) rename {spring-boot-ops => spring-mvc-simple-2}/src/main/java/org/baeldung/boot/repository/GenericEntityRepository.java (100%) rename {spring-boot-ops => spring-mvc-simple-2}/src/main/java/org/baeldung/boot/web/resolver/HeaderVersionArgumentResolver.java (100%) rename {spring-boot-ops => spring-mvc-simple-2}/src/main/java/org/baeldung/boot/web/resolver/Version.java (100%) rename {spring-boot-ops/src/test/java/org => spring-mvc-simple-2/src/test/java/com}/baeldung/SpringBootApplicationIntegrationTest.java (99%) rename {spring-boot-ops/src/test/java/org => spring-mvc-simple-2/src/test/java/com}/baeldung/SpringBootJPAIntegrationTest.java (98%) rename {spring-boot-ops/src/test/java/org => spring-mvc-simple-2/src/test/java/com}/baeldung/SpringBootMailIntegrationTest.java (99%) diff --git a/spring-boot-artifacts/README.md b/spring-boot-artifacts/README.md new file mode 100644 index 0000000000..0a3f1b7e60 --- /dev/null +++ b/spring-boot-artifacts/README.md @@ -0,0 +1,7 @@ +### 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) + - [Spring Properties File Outside jar](https://www.baeldung.com/spring-properties-file-outside-jar) + - [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 98% rename from spring-boot-ops/pom.xml rename to spring-boot-artifacts/pom.xml index f578a24163..756864895d 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 diff --git a/spring-boot-ops/src/main/java/com/baeldung/properties/ConfProperties.java b/spring-boot-artifacts/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-artifacts/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-artifacts/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-artifacts/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-artifacts/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-artifacts/src/main/java/com/baeldung/properties/ExternalPropertyFileLoader.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/external/conf.properties b/spring-boot-artifacts/src/main/resources/external/conf.properties similarity index 100% rename from spring-boot-ops/src/main/resources/external/conf.properties rename to spring-boot-artifacts/src/main/resources/external/conf.properties 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/properties/ExternalPropertyFileLoaderIntegrationTest.java b/spring-boot-artifacts/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-artifacts/src/test/java/com/baeldung/properties/ExternalPropertyFileLoaderIntegrationTest.java 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..90c5d05e33 --- /dev/null +++ b/spring-boot-deployment/README.md @@ -0,0 +1,5 @@ +### 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) + - [Spring Boot Embedded Tomcat Logs](https://www.baeldung.com/spring-boot-embedded-tomcat-logs) diff --git a/spring-boot-deployment/pom.xml b/spring-boot-deployment/pom.xml new file mode 100644 index 0000000000..6802452ddf --- /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-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-2/src/main/resources/application-tomcat.properties b/spring-boot-deployment/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-deployment/src/main/resources/application-tomcat.properties diff --git a/spring-boot-deployment/src/main/resources/application.properties b/spring-boot-deployment/src/main/resources/application.properties new file mode 100644 index 0000000000..709574239b --- /dev/null +++ b/spring-boot-deployment/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-management/src/main/resources/logback.xml b/spring-boot-deployment/src/main/resources/logback.xml similarity index 55% 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-environment/README.md b/spring-boot-environment/README.md new file mode 100644 index 0000000000..57cf8b2461 --- /dev/null +++ b/spring-boot-environment/README.md @@ -0,0 +1,2 @@ +### Relevant Articles: + - [EnvironmentPostProcessor in Spring Boot](https://www.baeldung.com/spring-boot-environmentpostprocessor) diff --git a/spring-boot-environment/pom.xml b/spring-boot-environment/pom.xml new file mode 100644 index 0000000000..a957dcde1b --- /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/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-ops/src/main/resources/application.properties b/spring-boot-environment/src/main/resources/application.properties similarity index 100% rename from spring-boot-ops/src/main/resources/application.properties rename to spring-boot-environment/src/main/resources/application.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-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 b4218dc395..0000000000 --- a/spring-boot-ops-2/README.MD +++ /dev/null @@ -1,4 +0,0 @@ -### 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) 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 5be5c974d3..0000000000 --- a/spring-boot-ops/README.md +++ /dev/null @@ -1,14 +0,0 @@ -### Relevant Articles: - - [Deploy a Spring Boot WAR into a Tomcat Server](http://www.baeldung.com/spring-boot-war-tomcat-deploy) - - [Spring Boot Dependency Management with a Custom Parent](http://www.baeldung.com/spring-boot-dependency-management-custom-parent) - - [A Custom Data Binder in Spring MVC](http://www.baeldung.com/spring-mvc-custom-data-binder) - - [Create a Fat Jar App with Spring Boot](http://www.baeldung.com/deployable-fat-jar-spring-boot) - - [Introduction to WebJars](http://www.baeldung.com/maven-webjars) - - [Intro to Spring Boot Starters](http://www.baeldung.com/spring-boot-starters) - - [A Quick Guide to Maven Wrapper](http://www.baeldung.com/maven-wrapper) - - [Shutdown a Spring Boot Application](http://www.baeldung.com/spring-boot-shutdown) - - [Spring Boot Console Application](http://www.baeldung.com/spring-boot-console-app) - - [Comparing Embedded Servlet Containers in Spring Boot](http://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) diff --git a/spring-boot-runtime/README.md b/spring-boot-runtime/README.md new file mode 100644 index 0000000000..fb5e0b14de --- /dev/null +++ b/spring-boot-runtime/README.md @@ -0,0 +1,5 @@ +### Relevant Articles: + - [Shutdown a Spring Boot Application](https://www.baeldung.com/spring-boot-shutdown) + - [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) + 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..eab8ca3cc2 --- /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/compare/ComparisonApplication.java b/spring-boot-runtime/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-runtime/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-runtime/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-runtime/src/main/java/com/baeldung/compare/StartupEventHandler.java 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-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 6dfe789be4..312c174fff 100644 --- a/spring-mvc-simple-2/README.md +++ b/spring-mvc-simple-2/README.md @@ -1,2 +1,3 @@ ## 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) \ No newline at end of file diff --git a/spring-mvc-simple-2/pom.xml b/spring-mvc-simple-2/pom.xml index 74302cff78..ac1f9a661c 100644 --- a/spring-mvc-simple-2/pom.xml +++ b/spring-mvc-simple-2/pom.xml @@ -1,37 +1,152 @@ - - + + 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-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 + + + + + + + + - 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-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;