incomplete-co.de
incomplete-co.de

Reputation: 2137

Spring Boot Batch - execluding JobLauncherCommandLineRunner

i have a simple Spring Batch job configured in Spring Boot (something similar to the spring guides). at startup, it auto-detects and invokes JobLauncherCommandLineRunner and i want to stop that behavior. I want the job to only be fired by a defined trigger elsewhere in the app, not on startup.

i've tried the @ComponentScan(excludeFilters... approach but it still gets invoked.

any way to switch off this 'helper' class?

Upvotes: 5

Views: 3683

Answers (1)

Dave Syer
Dave Syer

Reputation: 58134

You can set spring.batch.job.enabled=false or you can set spring.batch.job.names=none (see source code for details).

Upvotes: 17

Related Questions