Update pom and make batch project can be compile

This commit is contained in:
YuCheng Hu 2021-04-16 14:16:43 -04:00
parent e84ba0f25c
commit 2e58e7c329
No known key found for this signature in database
GPG Key ID: 3B9F227012D903F2
6 changed files with 129 additions and 14 deletions

116
spring-batch/pom.xml Normal file
View File

@ -0,0 +1,116 @@
<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">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-batch</artifactId>
<version>0.1-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
</plugins>
</build>
<name>spring-batch</name>
<packaging>jar</packaging>
<parent>
<artifactId>parent-boot-2</artifactId>
<groupId>com.ossez</groupId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-boot-2</relativePath>
</parent>
<dependencies>
<!-- JAXB APIs & runtime no longer provided in JDK 11 -->
<!-- see http://openjdk.java.net/jeps/320 -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>${jaxb.version}</version>
<scope>runtime</scope>
</dependency>
<!-- SQLite database driver -->
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>${sqlite.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>${spring.version}</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-core</artifactId>
<version>${spring.batch.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-test</artifactId>
<version>${spring.batch.version}</version>
</dependency>
<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>${opencsv.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-batch</artifactId>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>${awaitility.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<spring.version>5.3.0</spring.version>
<spring.batch.version>4.3.0</spring.batch.version>
<sqlite.version>3.15.1</sqlite.version>
<opencsv.version>4.1</opencsv.version>
<jaxb.version>2.3.1</jaxb.version>
<awaitility.version>3.1.1</awaitility.version>
</properties>
</project>

View File

@ -1,12 +1,12 @@
package com.ossez.spring.batch;
import org.baeldung.batch.model.Transaction;
import org.baeldung.batch.service.CustomItemProcessor;
import org.baeldung.batch.service.CustomSkipPolicy;
import org.baeldung.batch.service.MissingUsernameException;
import org.baeldung.batch.service.NegativeAmountException;
import org.baeldung.batch.service.RecordFieldSetMapper;
import org.baeldung.batch.service.SkippingItemProcessor;
import com.ossez.spring.batch.model.Transaction;
import com.ossez.spring.batch.service.CustomItemProcessor;
import com.ossez.spring.batch.service.CustomSkipPolicy;
import com.ossez.spring.batch.service.MissingUsernameException;
import com.ossez.spring.batch.service.NegativeAmountException;
import com.ossez.spring.batch.service.RecordFieldSetMapper;
import com.ossez.spring.batch.service.SkippingItemProcessor;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;

View File

@ -1,8 +1,7 @@
package org.baeldung.batch.model;
import java.util.Date;
package com.ossez.spring.batch.model;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.Date;
@SuppressWarnings("restriction")
@XmlRootElement(name = "transactionRecord")

View File

@ -1,7 +1,7 @@
package com.ossez.spring.batch.partitioner;
import org.baeldung.batch.model.Transaction;
import org.baeldung.batch.service.RecordFieldSetMapper;
import com.ossez.spring.batch.model.Transaction;
import com.ossez.spring.batch.service.RecordFieldSetMapper;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;

View File

@ -3,7 +3,7 @@ package com.ossez.spring.batch.service;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import org.baeldung.batch.model.Transaction;
import com.ossez.spring.batch.model.Transaction;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.item.file.transform.FieldSet;
import org.springframework.validation.BindException;

View File

@ -1,6 +1,6 @@
package com.ossez.spring.batch.service;
import org.baeldung.batch.model.Transaction;
import com.ossez.spring.batch.model.Transaction;
import org.springframework.batch.item.ItemProcessor;
public class SkippingItemProcessor implements ItemProcessor<Transaction, Transaction> {