80 likes | 663 Views
Spring-Batch Tutorial. Getting Started Guide. Agenda. Software prerequisites Creating new batch application Setting up database Running a job. Prerequisites. JDK 1.4 or later Maven 2. Create a batch application. Use the spring-batch-app archetype mvn archetype:create
E N D
Spring-Batch Tutorial Getting Started Guide
Agenda • Software prerequisites • Creating new batch application • Setting up database • Running a job
Prerequisites • JDK 1.4 or later • Maven 2
Create a batch application • Use the spring-batch-app archetype mvn archetype:create -DarchetypeGroupId=org.springframework.batch -DarchetypeArtifactId=spring-batch-app -DarchetypeVersion=1.0-SNAPSHOT -DgroupId=org.myorganization -DartifactId=my-app-name
Setup the database • Create a schema using SQL script from/src/main/resources/db-schema-scripts • Edit JDBC connection properties in/src/main/resource/batch-jdbc.properties
Run a job • cd path/to/my-app-name • mvn test • mvn exec:exec
Look behind the curtains • src/main/resources/helloWorldJob.xml contains the job configuration • pom.xml contains the maven’s exec plugin configuration which launches the job with appropriately configured classpath