<aside> ๐ก Spring Batch 5๋ ์ต์ ๋ฒ์ ์ผ๋ก Java 17์ด ํ์ํ Spring Framework 6์ ๊ธฐ๋ฐ https://github.com/spring-projects/spring-batch/wiki/Spring-Batch-5.0-Migration-Guide#dependencies-upgrade
</aside>
implementation 'org.springframework.boot:spring-boot-starter-batch'
์ถ๊ฐ
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-batch'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation'org.springframework.boot:spring-boot-starter-quartz'
implementation 'org.postgresql:postgresql:42.7.2'
runtimeOnly 'org.postgresql:postgresql'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation 'org.junit.jupiter:junit-jupiter'
}
spring:
main:
allow-bean-definition-overriding: true
batch:
job:
enabled: true # ์๋ฒ ์ฌ์์์ ๋ฐฐ์น ์๋์คํ ๋ฐฉ์ง = false
jdbc:
initialize-schema: always
quartz:
job-store-type: jdbc
jdbc:
initialize-schema: always
# DB ...
//@EnableBatchProcessing // ๋ฐฐ์น ๊ธฐ๋ฅ ํ์ฑ spring 3.0 ์ด์์ ์ฌ์ฉํ์ง ์๋๋ค ๊ธฐ๋ณธ ์ค์ ์ด ๋ฐฑ์คํ ๋๋ค.
@EnableScheduling //Spring scheduler
@SpringBootApplication
public class BatchTestApplication {
public static void main(String[] args) {
SpringApplication.run(BatchTestApplication.class, args);
}
}
JobBuilderFactory
โ JobBuilder
ํ์์ผ๋ก ๋ณ๊ฒฝ