===== 표준프레임워크 Sample 프로젝트를 Gradle로 빌드환경 전환 ===== ==== 빌드 환경 전환 ==== - Eclipse Gradle Plugin 설치 * Buildship : [[http://www.egovframe.go.kr/wiki/doku.php?id=egovframework:dev4:dep:build_tool:gradle:buildship:%EA%B5%AC%ED%98%84%EB%8F%84%EA%B5%AC_%ED%94%8C%EB%9F%AC%EA%B7%B8%EC%9D%B8_buildship|설치가이드]] - Sample 프로젝트 생성 * 개발환경 > eGovFrame > New Web Project > [프로젝트 정보 입력-Next] > Generate Example 체크 [Finish] (또는) \\ * 개발환경 > file > New > eGovfroame Web Project > [프로젝트 정보 입력-Next] > Generate Example 체크 [Finish] \\ {{:egovframework:dev3.6:dep:build_tool:gradle:buildship:gradle.sample.01.png|생성 프로젝트 선택}} \\ {{:egovframework:dev3.6:dep:build_tool:gradle:buildship:gradle.sample.02.png|프로젝트 정보 입력}} {{:egovframework:dev3.6:dep:build_tool:gradle:buildship:gradle.sample.03.png|게시판 컨텐츠 자동생성 체크}}\\ {{:egovframework:dev3.6:dep:build_tool:gradle:buildship:gradle.sample.04.png|메이븐 프로젝트 속성 확인}} \\ - build.gradle 파일 추가 * [[:egovframework:dev4.2:dep:build_tool:togradle#build.gradle_파일|build.gradle]] \\ {{:egovframework:dev3.6:dep:build_tool:gradle:buildship:gradle.sample.05.png|파일생성}} \\ {{:egovframework:dev3.6:dep:build_tool:gradle:buildship:gradle.sample.06.png|파일명입력}} - 기존 Maven Nature 삭제 * Mavne > Disable Maven Nature \\ {{:egovframework:dev3.6:dep:build_tool:gradle:buildship:gradle.sample.07.png|Maven Nature 삭제}} {{:egovframework:dev3.6:dep:build_tool:gradle:buildship:gradle.sample.08.png|Compile 오류}} \\ - Gradle Nature 추가 * Configure > Add Gradle Nature \\ {{:egovframework:dev3.6:dep:build_tool:gradle:buildship:gradle.sample.09.png|Gradle Nature 추가}} {{:egovframework:dev3.6:dep:build_tool:gradle:buildship:gradle.sample.10.png|Compile 오류 정리}} \\ - pom.xml 삭제 - Gradle 설정 확인 * Gradle > Refresh Gradle Project \\ {{:egovframework:dev3.6:dep:build_tool:gradle:buildship:gradle.sample.11.png|Task 재구성}} \\ - Gradle Tasks View 열기 * Window > Show View > Gradle > Gradle Tasks \\ {{:egovframework:dev3.6:dep:build_tool:gradle:buildship:gradle.install14.png|}} \\ - Gradle Tasks View에 표시된 프로젝트 Build * 프로젝트에 구성된 Task를 시작메뉴를 이용하여 빌드실행 \\ {{:egovframework:dev3.6:dep:build_tool:gradle:buildship:gradle.sample.12.png|기본 Task 실행}} \\ {{:egovframework:dev3.6:dep:build_tool:gradle:buildship:gradle.sample.13.png|Task 실행결과}} \\ - Gradle 프로젝트 실행 * Run As > Run On Server {{:egovframework:dev3.6:dep:build_tool:gradle:buildship:gradleprjrun.png|}} ==== build.gradle 파일 ==== plugins { id 'java-library' id 'maven-publish' id 'war' id 'project-report' } repositories { mavenCentral() maven { url 'https://maven.egovframe.go.kr/maven' } } dependencies { implementation 'org.egovframe.rte:org.egovframe.rte.ptl.mvc:4.2.0' implementation 'org.egovframe.rte:org.egovframe.rte.psl.dataaccess:4.2.0' implementation 'org.egovframe.rte:org.egovframe.rte.fdl.idgnr:4.2.0' implementation 'org.egovframe.rte:org.egovframe.rte.fdl.property:4.2.0' implementation 'javax.servlet.jsp.jstl:jstl-api:1.2' implementation 'org.apache.taglibs:taglibs-standard-impl:1.2.5' implementation 'org.antlr:antlr:3.5' implementation 'org.hsqldb:hsqldb:2.7.2' implementation 'org.eclipse:yasson:1.0.2' implementation 'org.glassfish:javax.json:1.1.3' providedCompile 'javax.servlet:javax.servlet-api:4.0.1' } group = 'egovframe' version = '1.0.0' description = 'maven2gradle' java.sourceCompatibility = JavaVersion.VERSION_1_8 publishing { publications { maven(MavenPublication) { from(components.java) } } } ==== 참고 ==== 3rd party 라이브러리로 별도의 설치가 필요한 경우에는 다음을 참고한다. def libDir='src/main/webapp/WEB-INF/lib/project' repositories { flatDir { dirs libDir } } dependencies { // 3rd party 라이브러리로 별도의 설치 필요 implementation files("${libDir}/ojdbc6/11.2.0.3/ojdbc6-11.2.0.3.jar") implementation files("${libDir}/altibase/7.1.0/altibase-7.1.0.jar") implementation files("${libDir}/tibero5/5.0.0/tibero5-5.0.0.jar") implementation files("${libDir}/cubrid/10.2.0/cubrid-10.2.0.jar") implementation files("${libDir}/goldilocks8/8.0.0/goldilocks8-8.0.0.jar") implementation files("${libDir}/smeapi/2.7.0/smeapi-2.7.0.jar") implementation files("${libDir}/gpkisecureweb/1.0.4.9/gpkisecureweb-1.0.4.9.jar") implementation files("${libDir}/libgpkiapi/1.4.0/libgpkiapi-1.4.0.jar") implementation files("${libDir}/onepass/2.0.0/onepass-2.0.0.jar") implementation files("${libDir}/OmniEntSDKCore/1.0.3.5/OmniEntSDKCore-1.0.3.5.jar") implementation files("${libDir}/OmniEntSDKServerCore/1.0.3.5/OmniEntSDKServerCore-1.0.3.5.jar") implementation files("${libDir}/OmniEntSDKVerifier/1.0.3.6/OmniEntSDKVerifier-1.0.3.6.jar") implementation files("${libDir}/RSLicenseSDK/1.0.4/RSLicenseSDK-1.0.4.jar") }