Skip to content

Commit 3052a53

Browse files
author
eugenp
committed
spring batch work
1 parent f3936e2 commit 3052a53

File tree

13 files changed

+22
-17
lines changed

13 files changed

+22
-17
lines changed
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
<attribute name="maven.pomderived" value="true"/>
1313
</attributes>
1414
</classpathentry>
15-
<classpathentry including="**/*.java" kind="src" path="src/main/resources"/>
15+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
16+
<attributes>
17+
<attribute name="maven.pomderived" value="true"/>
18+
</attributes>
19+
</classpathentry>
1620
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
1721
<attributes>
1822
<attribute name="maven.pomderived" value="true"/>
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
3-
<name>spring-batch-intro</name>
3+
<name>spring-batch</name>
44
<comment></comment>
55
<projects>
66
</projects>
@@ -15,8 +15,14 @@
1515
<arguments>
1616
</arguments>
1717
</buildCommand>
18+
<buildCommand>
19+
<name>org.springframework.ide.eclipse.core.springbuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
1823
</buildSpec>
1924
<natures>
25+
<nature>org.springframework.ide.eclipse.core.springnature</nature>
2026
<nature>org.eclipse.jdt.core.javanature</nature>
2127
<nature>org.eclipse.m2e.core.maven2Nature</nature>
2228
</natures>
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
32
<modelVersion>4.0.0</modelVersion>
43

54
<groupId>org.baeldung</groupId>
6-
<artifactId>spring-batch-intro</artifactId>
5+
<artifactId>spring-batch</artifactId>
76
<version>0.1-SNAPSHOT</version>
87
<packaging>jar</packaging>
98

10-
<name>spring-batch-intro</name>
9+
<name>spring-batch</name>
1110
<url>http://maven.apache.org</url>
1211

1312
<properties>

spring-batch-intro/src/main/java/org/baeldung/spring_batch_intro/App.java renamed to spring-batch/src/main/java/org/baeldung/spring_batch_intro/App.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,27 @@
44
import org.springframework.batch.core.JobExecution;
55
import org.springframework.batch.core.JobParameters;
66
import org.springframework.batch.core.launch.JobLauncher;
7-
import org.springframework.context.ApplicationContext;
87
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
9-
import org.springframework.context.support.ClassPathXmlApplicationContext;
10-
118

129
public class App {
13-
public static void main(String[] args) {
10+
public static void main(final String[] args) {
1411
// Spring Java config
15-
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
12+
final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
1613
context.register(SpringConfig.class);
1714
context.register(SpringBatchConfig.class);
1815
context.refresh();
1916

2017
// Spring xml config
21-
// ApplicationContext context = new ClassPathXmlApplicationContext(
22-
// "spring-batch-intro.xml");
18+
// ApplicationContext context = new ClassPathXmlApplicationContext("spring-batch.xml");
2319

24-
JobLauncher jobLauncher = (JobLauncher) context.getBean("jobLauncher");
25-
Job job = (Job) context.getBean("firstBatchJob");
20+
final JobLauncher jobLauncher = (JobLauncher) context.getBean("jobLauncher");
21+
final Job job = (Job) context.getBean("firstBatchJob");
2622
System.out.println("Starting the batch job");
2723
try {
28-
JobExecution execution = jobLauncher.run(job, new JobParameters());
24+
final JobExecution execution = jobLauncher.run(job, new JobParameters());
2925
System.out.println("Job Status : " + execution.getStatus());
3026
System.out.println("Job succeeded");
31-
} catch (Exception e) {
27+
} catch (final Exception e) {
3228
e.printStackTrace();
3329
System.out.println("Job failed");
3430
}

spring-batch-intro/src/main/java/org/baeldung/spring_batch_intro/SpringBatchConfig.java renamed to spring-batch/src/main/java/org/baeldung/spring_batch_intro/SpringBatchConfig.java

File renamed without changes.

spring-batch-intro/src/main/java/org/baeldung/spring_batch_intro/SpringConfig.java renamed to spring-batch/src/main/java/org/baeldung/spring_batch_intro/SpringConfig.java

File renamed without changes.

spring-batch-intro/src/main/java/org/baeldung/spring_batch_intro/model/Transaction.java renamed to spring-batch/src/main/java/org/baeldung/spring_batch_intro/model/Transaction.java

File renamed without changes.

spring-batch-intro/src/main/java/org/baeldung/spring_batch_intro/service/CustomItemProcessor.java renamed to spring-batch/src/main/java/org/baeldung/spring_batch_intro/service/CustomItemProcessor.java

File renamed without changes.

spring-batch-intro/src/main/java/org/baeldung/spring_batch_intro/service/RecordFieldSetMapper.java renamed to spring-batch/src/main/java/org/baeldung/spring_batch_intro/service/RecordFieldSetMapper.java

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)