Skip to content

Commit ad29a3c

Browse files
committed
Create spring-boot-quartz module
1 parent 4e33f2e commit ad29a3c

File tree

29 files changed

+86
-49
lines changed

29 files changed

+86
-49
lines changed

settings.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ include "spring-boot-project:spring-boot-mail"
7777
include "spring-boot-project:spring-boot-mustache"
7878
include "spring-boot-project:spring-boot-parent"
7979
include "spring-boot-project:spring-boot-pulsar"
80+
include "spring-boot-project:spring-boot-quartz"
8081
include "spring-boot-project:spring-boot-r2dbc"
8182
include "spring-boot-project:spring-boot-reactor-netty"
8283
include "spring-boot-project:spring-boot-rsocket"

spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ dependencies {
3535
optional(project(":spring-boot-project:spring-boot-liquibase"))
3636
optional(project(":spring-boot-project:spring-boot-mail"))
3737
optional(project(":spring-boot-project:spring-boot-neo4j"))
38+
optional(project(":spring-boot-project:spring-boot-quartz"))
3839
optional(project(":spring-boot-project:spring-boot-r2dbc"))
3940
optional(project(":spring-boot-project:spring-boot-reactor-netty"))
4041
optional(project(":spring-boot-project:spring-boot-tomcat"))

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/quartz/QuartzEndpointAutoConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -29,8 +29,8 @@
2929
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
3030
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
3131
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
32-
import org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration;
3332
import org.springframework.boot.context.properties.EnableConfigurationProperties;
33+
import org.springframework.boot.quartz.autoconfigure.QuartzAutoConfiguration;
3434
import org.springframework.context.annotation.Bean;
3535

3636
/**

spring-boot-project/spring-boot-autoconfigure-all/build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ dependencies {
160160
optional("org.opensaml:opensaml-core:4.0.1")
161161
optional("org.opensaml:opensaml-saml-api:4.0.1")
162162
optional("org.opensaml:opensaml-saml-impl:4.0.1")
163-
optional("org.quartz-scheduler:quartz")
164163
optional("org.springframework:spring-aspects")
165164
optional("org.springframework:spring-jdbc")
166165
optional("org.springframework:spring-jms")

spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json

-11
Original file line numberDiff line numberDiff line change
@@ -846,17 +846,6 @@
846846
"level": "error"
847847
}
848848
},
849-
{
850-
"name": "spring.quartz.jdbc.comment-prefix",
851-
"defaultValue": [
852-
"#",
853-
"--"
854-
]
855-
},
856-
{
857-
"name": "spring.quartz.scheduler-name",
858-
"defaultValue": "quartzScheduler"
859-
},
860849
{
861850
"name": "spring.reactor.stacktrace-mode.enabled",
862851
"description": "Whether Reactor should collect stacktrace information at runtime.",

spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring.factories

-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ org.springframework.boot.autoconfigure.web.servlet.JspTemplateAvailabilityProvid
1313

1414
# Depends on Database Initialization Detectors
1515
org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitializationDetector=\
16-
org.springframework.boot.autoconfigure.quartz.SchedulerDependsOnDatabaseInitializationDetector,\
1716
org.springframework.boot.autoconfigure.session.JdbcIndexedSessionRepositoryDependsOnDatabaseInitializationDetector

spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ org.springframework.boot.autoconfigure.ldap.LdapAutoConfiguration
5252
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration
5353
org.springframework.boot.autoconfigure.mongo.MongoReactiveAutoConfiguration
5454
org.springframework.boot.autoconfigure.netty.NettyAutoConfiguration
55-
org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration
5655
org.springframework.boot.autoconfigure.reactor.ReactorAutoConfiguration
5756
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration
5857
org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration

spring-boot-project/spring-boot-dependencies/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -2058,6 +2058,7 @@ bom {
20582058
"spring-boot-neo4j",
20592059
"spring-boot-properties-migrator",
20602060
"spring-boot-pulsar",
2061+
"spring-boot-quartz",
20612062
"spring-boot-r2dbc",
20622063
"spring-boot-reactor-netty",
20632064
"spring-boot-rsocket",

spring-boot-project/spring-boot-docs/build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ dependencies {
7979
autoConfiguration(project(path: ":spring-boot-project:spring-boot-mustache", configuration: "autoConfigurationMetadata"))
8080
autoConfiguration(project(path: ":spring-boot-project:spring-boot-neo4j", configuration: "autoConfigurationMetadata"))
8181
autoConfiguration(project(path: ":spring-boot-project:spring-boot-pulsar", configuration: "autoConfigurationMetadata"))
82+
autoConfiguration(project(path: ":spring-boot-project:spring-boot-quartz", configuration: "autoConfigurationMetadata"))
8283
autoConfiguration(project(path: ":spring-boot-project:spring-boot-r2dbc", configuration: "autoConfigurationMetadata"))
8384
autoConfiguration(project(path: ":spring-boot-project:spring-boot-reactor-netty", configuration: "autoConfigurationMetadata"))
8485
autoConfiguration(project(path: ":spring-boot-project:spring-boot-rsocket", configuration: "autoConfigurationMetadata"))
@@ -119,6 +120,7 @@ dependencies {
119120
configurationProperties(project(path: ":spring-boot-project:spring-boot-mustache", configuration: "configurationPropertiesMetadata"))
120121
configurationProperties(project(path: ":spring-boot-project:spring-boot-neo4j", configuration: "configurationPropertiesMetadata"))
121122
configurationProperties(project(path: ":spring-boot-project:spring-boot-pulsar", configuration: "configurationPropertiesMetadata"))
123+
configurationProperties(project(path: ":spring-boot-project:spring-boot-quartz", configuration: "configurationPropertiesMetadata"))
122124
configurationProperties(project(path: ":spring-boot-project:spring-boot-r2dbc", configuration: "configurationPropertiesMetadata"))
123125
configurationProperties(project(path: ":spring-boot-project:spring-boot-reactor-netty", configuration: "configurationPropertiesMetadata"))
124126
configurationProperties(project(path: ":spring-boot-project:spring-boot-rsocket", configuration: "configurationPropertiesMetadata"))

spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/io/quartz.adoc

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ To use a custom script, set the configprop:spring.quartz.jdbc.schema[] property.
3737
Some of the standard scripts – such as those for SQL Server, Azure SQL, and Sybase – cannot be used without modification.
3838
In these cases, make a copy of the script and edit it as directed in the script's comments then set configprop:spring.quartz.jdbc.schema[] to use your customized script.
3939

40-
To have Quartz use a javadoc:javax.sql.DataSource[] other than the application's main javadoc:javax.sql.DataSource[], declare a javadoc:javax.sql.DataSource[] bean, annotating its javadoc:org.springframework.context.annotation.Bean[format=annotation] method with javadoc:org.springframework.boot.autoconfigure.quartz.QuartzDataSource[format=annotation].
40+
To have Quartz use a javadoc:javax.sql.DataSource[] other than the application's main javadoc:javax.sql.DataSource[], declare a javadoc:javax.sql.DataSource[] bean, annotating its javadoc:org.springframework.context.annotation.Bean[format=annotation] method with javadoc:org.springframework.boot.quartz.autoconfigure.QuartzDataSource[format=annotation].
4141
Doing so ensures that the Quartz-specific javadoc:javax.sql.DataSource[] is used by both the javadoc:org.springframework.scheduling.quartz.SchedulerFactoryBean[] and for schema initialization.
42-
Similarly, to have Quartz use a javadoc:org.springframework.transaction.TransactionManager[] other than the application's main javadoc:org.springframework.transaction.TransactionManager[] declare a javadoc:org.springframework.transaction.TransactionManager[] bean, annotating its javadoc:org.springframework.context.annotation.Bean[format=annotation] method with javadoc:org.springframework.boot.autoconfigure.quartz.QuartzTransactionManager[format=annotation].
42+
Similarly, to have Quartz use a javadoc:org.springframework.transaction.TransactionManager[] other than the application's main javadoc:org.springframework.transaction.TransactionManager[] declare a javadoc:org.springframework.transaction.TransactionManager[] bean, annotating its javadoc:org.springframework.context.annotation.Bean[format=annotation] method with javadoc:org.springframework.boot.quartz.autoconfigure.QuartzTransactionManager[format=annotation].
4343

4444
By default, jobs created by configuration will not overwrite already registered jobs that have been read from a persistent job store.
4545
To enable overwriting existing job definitions set the configprop:spring.quartz.overwrite-existing-jobs[] property.
4646

47-
Quartz Scheduler configuration can be customized using `spring.quartz` properties and javadoc:org.springframework.boot.autoconfigure.quartz.SchedulerFactoryBeanCustomizer[] beans, which allow programmatic javadoc:org.springframework.scheduling.quartz.SchedulerFactoryBean[] customization.
47+
Quartz Scheduler configuration can be customized using `spring.quartz` properties and javadoc:org.springframework.boot.quartz.autoconfigure.SchedulerFactoryBeanCustomizer[] beans, which allow programmatic javadoc:org.springframework.scheduling.quartz.SchedulerFactoryBean[] customization.
4848
Advanced Quartz configuration properties can be customized using `spring.quartz.properties.*`.
4949

5050
NOTE: In particular, an javadoc:java.util.concurrent.Executor[] bean is not associated with the scheduler as Quartz offers a way to configure the scheduler through `spring.quartz.properties`.
51-
If you need to customize the task executor, consider implementing javadoc:org.springframework.boot.autoconfigure.quartz.SchedulerFactoryBeanCustomizer[].
51+
If you need to customize the task executor, consider implementing javadoc:org.springframework.boot.quartz.autoconfigure.SchedulerFactoryBeanCustomizer[].
5252

5353
Jobs can define setters to inject data map properties.
5454
Regular beans can also be injected in a similar manner, as shown in the following example:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
plugins {
2+
id "java-library"
3+
id "org.springframework.boot.auto-configuration"
4+
id "org.springframework.boot.configuration-properties"
5+
id "org.springframework.boot.deployed"
6+
id "org.springframework.boot.optional-dependencies"
7+
}
8+
9+
description = "Spring Boot Quartz"
10+
11+
dependencies {
12+
api(project(":spring-boot-project:spring-boot-tx"))
13+
api("org.quartz-scheduler:quartz")
14+
api("org.springframework:spring-context-support")
15+
16+
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
17+
optional(project(":spring-boot-project:spring-boot-jdbc"))
18+
19+
testImplementation(project(":spring-boot-project:spring-boot-flyway"))
20+
testImplementation(project(":spring-boot-project:spring-boot-liquibase"))
21+
testImplementation(project(":spring-boot-project:spring-boot-test"))
22+
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
23+
24+
testRuntimeOnly("ch.qos.logback:logback-classic")
25+
testRuntimeOnly("com.h2database:h2")
26+
testRuntimeOnly("com.zaxxer:HikariCP")
27+
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,13 +14,13 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.quartz;
17+
package org.springframework.boot.quartz.autoconfigure;
1818

1919
/**
2020
* Define the supported Quartz {@code JobStore}.
2121
*
2222
* @author Stephane Nicoll
23-
* @since 2.0.0
23+
* @since 4.0.0
2424
*/
2525
public enum JobStoreType {
2626

Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.quartz;
17+
package org.springframework.boot.quartz.autoconfigure;
1818

1919
import java.util.Map;
2020
import java.util.Properties;
@@ -52,7 +52,7 @@
5252
*
5353
* @author Vedran Pavic
5454
* @author Stephane Nicoll
55-
* @since 2.0.0
55+
* @since 4.0.0
5656
*/
5757
@AutoConfiguration(after = DataSourceAutoConfiguration.class,
5858
afterName = "org.springframework.boot.jpa.autoconfigure.hibernate.HibernateJpaAutoConfiguration")
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.quartz;
17+
package org.springframework.boot.quartz.autoconfigure;
1818

1919
import java.lang.annotation.Documented;
2020
import java.lang.annotation.ElementType;
@@ -31,7 +31,7 @@
3131
*
3232
* @author Madhura Bhave
3333
* @see QuartzDataSource
34-
* @since 2.0.2
34+
* @since 4.0.0
3535
*/
3636
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.TYPE, ElementType.ANNOTATION_TYPE })
3737
@Retention(RetentionPolicy.RUNTIME)
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.quartz;
17+
package org.springframework.boot.quartz.autoconfigure;
1818

1919
import java.util.List;
2020

@@ -35,7 +35,7 @@
3535
* @author Vedran Pavic
3636
* @author Andy Wilkinson
3737
* @author Phillip Webb
38-
* @since 2.6.0
38+
* @since 4.0.0
3939
*/
4040
public class QuartzDataSourceScriptDatabaseInitializer extends DataSourceScriptDatabaseInitializer {
4141

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.quartz;
17+
package org.springframework.boot.quartz.autoconfigure;
1818

1919
import java.time.Duration;
2020
import java.util.ArrayList;
@@ -31,7 +31,7 @@
3131
*
3232
* @author Vedran Pavic
3333
* @author Stephane Nicoll
34-
* @since 2.0.0
34+
* @since 4.0.0
3535
*/
3636
@ConfigurationProperties("spring.quartz")
3737
public class QuartzProperties {
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.quartz;
17+
package org.springframework.boot.quartz.autoconfigure;
1818

1919
import java.lang.annotation.Documented;
2020
import java.lang.annotation.ElementType;
@@ -31,7 +31,7 @@
3131
*
3232
* @author Andy Wilkinson
3333
* @see QuartzDataSource
34-
* @since 2.2.11
34+
* @since 4.0.0
3535
*/
3636
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.TYPE, ElementType.ANNOTATION_TYPE })
3737
@Retention(RetentionPolicy.RUNTIME)
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.quartz;
17+
package org.springframework.boot.quartz.autoconfigure;
1818

1919
import java.util.Arrays;
2020
import java.util.HashSet;
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.quartz;
17+
package org.springframework.boot.quartz.autoconfigure;
1818

1919
import javax.sql.DataSource;
2020

@@ -31,7 +31,7 @@
3131
* {@link QuartzDataSourceScriptDatabaseInitializer}.
3232
*
3333
* @author Vedran Pavic
34-
* @since 2.0.0
34+
* @since 4.0.0
3535
*/
3636
@FunctionalInterface
3737
public interface SchedulerFactoryBeanCustomizer {
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,4 +17,4 @@
1717
/**
1818
* Auto-configuration for Quartz Scheduler.
1919
*/
20-
package org.springframework.boot.autoconfigure.quartz;
20+
package org.springframework.boot.quartz.autoconfigure;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"groups": [],
3+
"properties": [
4+
{
5+
"name": "spring.quartz.jdbc.comment-prefix",
6+
"defaultValue": [
7+
"#",
8+
"--"
9+
]
10+
},
11+
{
12+
"name": "spring.quartz.scheduler-name",
13+
"defaultValue": "quartzScheduler"
14+
}
15+
]
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Depends on Database Initialization Detectors
2+
org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitializationDetector=\
3+
org.springframework.boot.quartz.autoconfigure.SchedulerDependsOnDatabaseInitializationDetector
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.springframework.boot.quartz.autoconfigure.QuartzAutoConfiguration
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.quartz;
17+
package org.springframework.boot.quartz.autoconfigure;
1818

1919
import java.io.InputStream;
2020
import java.nio.file.Files;
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.quartz;
17+
package org.springframework.boot.quartz.autoconfigure;
1818

1919
import java.util.Arrays;
2020

0 commit comments

Comments
 (0)