Spring batch 启动时将作业加载到Spring批处理管理员

Spring batch 启动时将作业加载到Spring批处理管理员,spring-batch,Spring Batch,从SpringBatch管理文档中,它提到如果作业配置文件位于META-INF/Spring/Batch/jobs/*.xml下的类路径中,则将加载作业 在STS附带的spring batch admin示例中,作业在部署admin web应用程序时加载到文件classpath:\META-INF\batch\module-context.xml下,并在部署时引导。不知道这是怎么回事 虽然我可以通过在用户界面中上传来加载作业配置,但由于某些原因,我的一些自定义bean没有自动连接。因此,理想的

从SpringBatch管理文档中,它提到如果作业配置文件位于META-INF/Spring/Batch/jobs/*.xml下的类路径中,则将加载作业

在STS附带的spring batch admin示例中,作业在部署admin web应用程序时加载到文件classpath:\META-INF\batch\module-context.xml下,并在部署时引导。不知道这是怎么回事

虽然我可以通过在用户界面中上传来加载作业配置,但由于某些原因,我的一些自定义bean没有自动连接。因此,理想的行为是在部署Admin时加载所有作业


先谢谢你

经过几轮挖掘后,我能够加载作业文件。我必须将作业文件放置在/META-INF/spring/batch/jobs/folder not/META-INF/batch/文件夹中,以便我的jobLauncher、jobRepository、dataSource等在加载时获得发现。我必须把它放在src/main/resources/META-INF/spring/batch/spring/batch/bootstrap/**/

都是因为org.springframework.batch.admin.web.resources中spring-batch-admin-resources-1.2.0.RELEASE.jar中的两个文件

servlet-config.xml

<import resource="classpath*:/META-INF/spring/batch/servlet/resources/*.xml" />
<import resource="classpath*:/META-INF/spring/batch/servlet/manager/*.xml" />
<import resource="classpath*:/META-INF/spring/batch/servlet/override/*.xml" />
<import resource="classpath*:/META-INF/spring/batch/bootstrap/**/*.xml" />
<import resource="classpath*:/META-INF/spring/batch/override/**/*.xml" />

它允许我在src/main/resources/META-INF/spring/batch/servlet/override/*xml下添加菜单和控制器

webapp-config.xml

<import resource="classpath*:/META-INF/spring/batch/servlet/resources/*.xml" />
<import resource="classpath*:/META-INF/spring/batch/servlet/manager/*.xml" />
<import resource="classpath*:/META-INF/spring/batch/servlet/override/*.xml" />
<import resource="classpath*:/META-INF/spring/batch/bootstrap/**/*.xml" />
<import resource="classpath*:/META-INF/spring/batch/override/**/*.xml" />

我把我的启动上下文放在哪里