mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
* Auto config in main bootstrap jar * Compiler enhancements in groovy cli * Sample script in cli samples [Fixes #48716881], [Fixes #48788313]
36 lines
641 B
Groovy
36 lines
641 B
Groovy
package org.test
|
|
|
|
@Grab("org.hsqldb:hsqldb-j5:2.0.0")
|
|
@Configuration
|
|
@EnableBatchProcessing
|
|
class JobConfig {
|
|
|
|
@Autowired
|
|
private JobBuilderFactory jobs
|
|
|
|
@Autowired
|
|
private StepBuilderFactory steps
|
|
|
|
@Bean
|
|
protected Tasklet tasklet() {
|
|
return new Tasklet() {
|
|
@Override
|
|
RepeatStatus execute(StepContribution contribution, ChunkContext context) {
|
|
return RepeatStatus.FINISHED
|
|
}
|
|
}
|
|
}
|
|
|
|
@Bean
|
|
Job job() throws Exception {
|
|
return jobs.get("job").start(step1()).build()
|
|
}
|
|
|
|
@Bean
|
|
protected Step step1() throws Exception {
|
|
return steps.get("step1").tasklet(tasklet()).build()
|
|
}
|
|
}
|
|
|
|
|