개발 환경 설정

2018. 9. 17. 00:32Spring Batch

반응형

개발예제를 시작하기전에 프로젝트 설정에 필요한 내용을 정리해보자

    • 전자정부프레임워크 메이븐 로컬 레파지토리 등록하기
    • 메이븐 프로젝트 생성 후 pom.xml 설정하기
    • 데이터 베이스 설치

1.로컬레파지토리 등록 라이브러리 목록

   Maven Central Repository 등록 되지 않은 라이브러리들을 로컬레파지토리에 등록한다.

   

   1) 전자정부프레임워크

      http://www.egovframe.go.kr/EgovRunEnvRelease_300.jsp?menu=3&submenu=1&leftsub=2 주소에서 배치레이어

      version 3.7.0  버전을 다운받는다. 

      다운 로드 후 아래 라이브러리들을 로컬 레파지토리에 등록 해 준다.

 

      mvn install:install-file -Dfile={라이브러리경로}/egovframework.rte.bat.core-3.7.0.jar 

-DgroupId=egovframework.rte -DartifactId=egovframework.rte.bat.core -Dversion=3.7.0 -Dpackaging=jar

 

mvn install:install-file -Dfile={라이브러리경로}/egovframework.rte.ptl.mvc-3.7.0.jar 

-DgroupId=egovframework.rte -DartifactId=egovframework.rte.ptl.mvc -Dversion=3.7.0 -Dpackaging=jar

 

mvn install:install-file -Dfile={라이브러리경로}/egovframework.rte.psl.dataaccess-3.7.0.jar 

-DgroupId=egovframework.rte -DartifactId=egovframework.rte.psl.dataaccess -Dversion=3.7.0 -Dpackaging=jar

 

mvn install:install-file -Dfile={라이브러리경로}/egovframework.rte.fdl.property-3.6.0.jar 

-DgroupId=egovframework.rte -DartifactId=egovframework.rte.fdl.property -Dversion=3.6.0 -Dpackaging=jar

 

mvn install:install-file -Dfile={라이브러리경로}/egovframework.rte.fdl.cmmn-3.7.0.jar 

-DgroupId=egovframework.rte -DartifactId=egovframework.rte.fdl.cmmn -Dversion=3.7.0 -Dpackaging=jar

 

mvn install:install-file -Dfile={라이브러리경로}/ojdbc7.jar -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.1.0 -Dpackaging=jar

 

3. 메이븐 프로젝트 생성 후 pom.xml 작성

<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>
	
	<groupId>com.batchguide</groupId>
	<artifactId>spring_batch_tutorial</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>jar</packaging>
	<name>spring_batch_tutorial</name>
	<url>http://maven.apache.org</url>

  	<properties>
		<jdk.version>1.8</jdk.version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<egovframework.rte.version>3.7.0</egovframework.rte.version>
		<springframework.batch.core.version>4.0.1.RELEASE</springframework.batch.core.version>
		<springframework.jdbc.core.version>5.0.8.RELEASE</springframework.jdbc.core.version>
		<servlet.api.version>2.5</servlet.api.version>
		<persistence.api.version>1.0</persistence.api.version>
		<ojdbc.version>6</ojdbc.version>
		<commons.dbcp.version>1.4</commons.dbcp.version>
		<log4j.core.version>2.9.1</log4j.core.version>
		<log4j.version>1.2.17</log4j.version>
		<log4j.api.version>2.9.1</log4j.api.version>
		<log4j.slf4j.impl.version>2.9.1</log4j.slf4j.impl.version>
		<slf4j.api.version>1.7.25</slf4j.api.version>
		<slf4j.log4j12.version>1.7.25</slf4j.log4j12.version>
		<log4jdbc.log4j2.jdbc4.1.version>1.16</log4jdbc.log4j2.jdbc4.1.version>
		<mybatis.version>3.4.1</mybatis.version>
		<mybatis.spring.version>1.3.1</mybatis.spring.version>
	</properties>
	
	<dependencies>
		<!-- egovframework.rte -->
		<dependency>
			<groupId>egovframework.rte</groupId>
			<artifactId>egovframework.rte.bat.core</artifactId>
			<version>${egovframework.rte.version}</version>
		</dependency>
		<dependency>
			<groupId>egovframework.rte</groupId>
			<artifactId>egovframework.rte.psl.dataaccess</artifactId>
			<version>${egovframework.rte.version}</version>
		</dependency>
		<dependency>
			<groupId>egovframework.rte</groupId>
			<artifactId>egovframework.rte.fdl.property</artifactId>
			<version>3.6.0</version>
		</dependency>
		<dependency>
			<groupId>egovframework.rte</groupId>
			<artifactId>egovframework.rte.fdl.cmmn</artifactId>
			<version>${egovframework.rte.version}</version>
		</dependency>
		
		<!-- Springframework -->
		<dependency>
			<groupId>org.springframework.batch</groupId>
			<artifactId>spring-batch-core</artifactId>
			<version>${springframework.batch.core.version}</version>
		</dependency>		
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-jdbc</artifactId>
			<version>${springframework.jdbc.core.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-tx</artifactId>
			<version>5.0.8.RELEASE</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-webmvc</artifactId>
			<version>5.0.8.RELEASE</version>
		</dependency>
		
		<!-- servlet -->
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<scope>provided</scope>
			<version>${servlet.api.version}</version>
		</dependency>
		
		<!-- Apache commons -->
		<dependency>
			<groupId>commons-dbcp</groupId>
			<artifactId>commons-dbcp</artifactId>
			<version>${commons.dbcp.version}</version>
		</dependency>
		
		<!-- persistence -->
		<dependency>
			<groupId>javax.persistence</groupId>
			<artifactId>persistence-api</artifactId>
			<version>${persistence.api.version}</version>
			<optional>true</optional>
		</dependency>
		
		<!-- log4j -->
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-slf4j-impl</artifactId>
			<version>2.9.0</version>
		</dependency>
		
		<!-- log4jdbc -->
		<dependency>
			<groupId>org.bgee.log4jdbc-log4j2</groupId>
			<artifactId>log4jdbc-log4j2-jdbc4.1</artifactId>
			<version>${log4jdbc.log4j2.jdbc4.1.version}</version>
		</dependency>
		
		<!-- mySql -->
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>8.0.11</version>
		</dependency>

		<!-- myBatis -->
		<dependency>
			<groupId>org.mybatis</groupId>
			<artifactId>mybatis</artifactId>
			<version>${mybatis.version}</version>
		</dependency>
		<dependency>
			<groupId>org.mybatis</groupId>
			<artifactId>mybatis-spring</artifactId>
			<version>${mybatis.spring.version}</version>
		</dependency>
		
		<!-- jackson -->
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
			<version>2.1.4</version>
		</dependency>
		
		
	</dependencies>
		
	<build>
		<finalName>spring_batch_guide</finalName>
		<plugins> 
			<!-- JDK 설정 -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.7.0</version>
				<configuration>
					<source>${jdk.version}</source>
					<target>${jdk.version}</target>
					<fork>true</fork>
					
					<executable>C:\Java\jdk1.8.0_152\bin\javac</executable>
				</configuration>
			</plugin>
			
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.5</version>
				<executions>
					<execution>
						<id>package-jar</id>
						<phase>package</phase>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<archive>
						<manifest>
							<!-- Main class 파일 명시 -->
							<mainClass>com.batchguide.BatchJobRunner</mainClass>
						</manifest>
				  	</archive>
					<outputDirectory>C:\app</outputDirectory>
				</configuration>
			</plugin>
			
		</plugins>
	</build>
</project>

4.데이터베이스 설치

  mysql-installer-community-8.0.12.0 버전 설치

 

[소스레파지토리]

https://github.com/roopy1210/springbatch/blob/master/spring_batch_tutorial

반응형