Here is an example for both local jvm and native job variants:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<!-- QUARTZ JOBS -->
<bean id="localJvmJob" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass" value="org.springframework.batch.sample.launch.QuartzBatchJob" />
<property name="jobDataAsMap">
<map>
<entry key="jobName" value="fixedLengthImportJob" />
<entry key="jobConfigurationPath" value="jobs/fixedLengthImportJob.xml" />
</map>
</property>
</bean>
<bean id="nativeJob" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass" value="org.quartz.jobs.NativeJob" />
<property name="jobDataAsMap">
<map>
<entry key="command" value="java org.springframework.batch.execution.bootstrap.support.BatchCommandLineLauncher -Djob.configuration.path=jobs/fixedLengthImportJob.xml -Djob.name=fixedLengthImportJob" />
<entry key="jobConfigurationPath" value="jobs/fixedLengthImportJob.xml" />
</map>
</property>
</bean>
<!-- TRIGGERS -->
<bean id="exampleCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="nativeJob" />
<!-- run every morning at 6 AM -->
<property name="cronExpression" value="0 0 6 * * ?" />
</bean>
<bean id="exampleSimpleTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
<property name="jobDetail" ref="localJvmJob" />
<property name="startDelay" value="1000" />
<property name="repeatInterval" value="30000" />
</bean>
<!-- SCHEDULER -->
<bean id="quartzScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="exampleCronTrigger" />
<ref bean="exampleSimpleTrigger" />
</list>
</property>
</bean>
</beans>
The QuartzBatchJob class is basicly a copy-paste of BatchCommandLineLauncher#start method - maybe it is worth to extract this logic from the "command line" class?