From e703f71ada7b175ba06f522b1155fb9bd7b3a4fc Mon Sep 17 00:00:00 2001 From: dupirefr Date: Sun, 9 Feb 2020 11:01:39 +0100 Subject: [PATCH] * Moved Conditional Scheduling to spring-scheduling module --- spring-boot-modules/spring-boot-mvc/README.md | 1 - spring-scheduling/README.md | 1 + spring-scheduling/pom.xml | 4 ++++ .../scheduling/conditional}/ScheduleJobsByProfile.java | 2 +- .../com/baeldung/scheduling/conditional}/ScheduledJob.java | 2 +- .../scheduling/conditional}/ScheduledJobsWithBoolean.java | 2 +- .../scheduling/conditional}/ScheduledJobsWithConditional.java | 2 +- .../scheduling/conditional}/ScheduledJobsWithExpression.java | 2 +- .../scheduling/conditional}/SchedulingApplication.java | 2 +- 9 files changed, 11 insertions(+), 7 deletions(-) rename {spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling => spring-scheduling/src/main/java/com/baeldung/scheduling/conditional}/ScheduleJobsByProfile.java (91%) rename {spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling => spring-scheduling/src/main/java/com/baeldung/scheduling/conditional}/ScheduledJob.java (91%) rename {spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling => spring-scheduling/src/main/java/com/baeldung/scheduling/conditional}/ScheduledJobsWithBoolean.java (94%) rename {spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling => spring-scheduling/src/main/java/com/baeldung/scheduling/conditional}/ScheduledJobsWithConditional.java (93%) rename {spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling => spring-scheduling/src/main/java/com/baeldung/scheduling/conditional}/ScheduledJobsWithExpression.java (93%) rename {spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling => spring-scheduling/src/main/java/com/baeldung/scheduling/conditional}/SchedulingApplication.java (89%) diff --git a/spring-boot-modules/spring-boot-mvc/README.md b/spring-boot-modules/spring-boot-mvc/README.md index 529a8d7e1f..60d41f40da 100644 --- a/spring-boot-modules/spring-boot-mvc/README.md +++ b/spring-boot-modules/spring-boot-mvc/README.md @@ -13,7 +13,6 @@ This module contains articles about Spring Web MVC in Spring Boot projects. - [Display RSS Feed with Spring MVC](https://www.baeldung.com/spring-mvc-rss-feed) - [A Controller, Service and DAO Example with Spring Boot and JSF](https://www.baeldung.com/jsf-spring-boot-controller-service-dao) - [Setting Up Swagger 2 with a Spring REST API](https://www.baeldung.com/swagger-2-documentation-for-spring-rest-api) -- [Conditionally Enable Scheduled Jobs in Spring](https://www.baeldung.com/spring-scheduled-enabled-conditionally) - [Accessing Spring MVC Model Objects in JavaScript](https://www.baeldung.com/spring-mvc-model-objects-js) - [Using Spring ResponseEntity to Manipulate the HTTP Response](https://www.baeldung.com/spring-response-entity) - [Spring Bean Annotations](https://www.baeldung.com/spring-bean-annotations) diff --git a/spring-scheduling/README.md b/spring-scheduling/README.md index 2e3bb2b5e5..ddc540bafb 100644 --- a/spring-scheduling/README.md +++ b/spring-scheduling/README.md @@ -3,4 +3,5 @@ - [The @Scheduled Annotation in Spring](https://www.baeldung.com/spring-scheduled-tasks) - [Guide to Spring Retry](http://www.baeldung.com/spring-retry) - [How To Do @Async in Spring](http://www.baeldung.com/spring-async) +- [Conditionally Enable Scheduled Jobs in Spring](https://www.baeldung.com/spring-scheduled-enabled-conditionally) diff --git a/spring-scheduling/pom.xml b/spring-scheduling/pom.xml index 8726fea438..b27f33196d 100644 --- a/spring-scheduling/pom.xml +++ b/spring-scheduling/pom.xml @@ -27,6 +27,10 @@ org.springframework spring-aspects + + org.springframework.boot + spring-boot-starter-web + javax.annotation javax.annotation-api diff --git a/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduleJobsByProfile.java b/spring-scheduling/src/main/java/com/baeldung/scheduling/conditional/ScheduleJobsByProfile.java similarity index 91% rename from spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduleJobsByProfile.java rename to spring-scheduling/src/main/java/com/baeldung/scheduling/conditional/ScheduleJobsByProfile.java index 33cd44331f..7783d0e6ff 100644 --- a/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduleJobsByProfile.java +++ b/spring-scheduling/src/main/java/com/baeldung/scheduling/conditional/ScheduleJobsByProfile.java @@ -1,4 +1,4 @@ -package com.baeldung.scheduling; +package com.baeldung.scheduling.conditional; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJob.java b/spring-scheduling/src/main/java/com/baeldung/scheduling/conditional/ScheduledJob.java similarity index 91% rename from spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJob.java rename to spring-scheduling/src/main/java/com/baeldung/scheduling/conditional/ScheduledJob.java index df7cefcd3c..b56cb9ed5b 100644 --- a/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJob.java +++ b/spring-scheduling/src/main/java/com/baeldung/scheduling/conditional/ScheduledJob.java @@ -1,4 +1,4 @@ -package com.baeldung.scheduling; +package com.baeldung.scheduling.conditional; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJobsWithBoolean.java b/spring-scheduling/src/main/java/com/baeldung/scheduling/conditional/ScheduledJobsWithBoolean.java similarity index 94% rename from spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJobsWithBoolean.java rename to spring-scheduling/src/main/java/com/baeldung/scheduling/conditional/ScheduledJobsWithBoolean.java index b03de61641..69c0efb7b2 100644 --- a/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJobsWithBoolean.java +++ b/spring-scheduling/src/main/java/com/baeldung/scheduling/conditional/ScheduledJobsWithBoolean.java @@ -1,4 +1,4 @@ -package com.baeldung.scheduling; +package com.baeldung.scheduling.conditional; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJobsWithConditional.java b/spring-scheduling/src/main/java/com/baeldung/scheduling/conditional/ScheduledJobsWithConditional.java similarity index 93% rename from spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJobsWithConditional.java rename to spring-scheduling/src/main/java/com/baeldung/scheduling/conditional/ScheduledJobsWithConditional.java index 081c8d990a..2a90300c20 100644 --- a/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJobsWithConditional.java +++ b/spring-scheduling/src/main/java/com/baeldung/scheduling/conditional/ScheduledJobsWithConditional.java @@ -1,4 +1,4 @@ -package com.baeldung.scheduling; +package com.baeldung.scheduling.conditional; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJobsWithExpression.java b/spring-scheduling/src/main/java/com/baeldung/scheduling/conditional/ScheduledJobsWithExpression.java similarity index 93% rename from spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJobsWithExpression.java rename to spring-scheduling/src/main/java/com/baeldung/scheduling/conditional/ScheduledJobsWithExpression.java index 577a01f241..4842e649c7 100644 --- a/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJobsWithExpression.java +++ b/spring-scheduling/src/main/java/com/baeldung/scheduling/conditional/ScheduledJobsWithExpression.java @@ -1,4 +1,4 @@ -package com.baeldung.scheduling; +package com.baeldung.scheduling.conditional; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/SchedulingApplication.java b/spring-scheduling/src/main/java/com/baeldung/scheduling/conditional/SchedulingApplication.java similarity index 89% rename from spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/SchedulingApplication.java rename to spring-scheduling/src/main/java/com/baeldung/scheduling/conditional/SchedulingApplication.java index 913e2137f8..4777230341 100644 --- a/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/SchedulingApplication.java +++ b/spring-scheduling/src/main/java/com/baeldung/scheduling/conditional/SchedulingApplication.java @@ -1,4 +1,4 @@ -package com.baeldung.scheduling; +package com.baeldung.scheduling.conditional; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;