===== 표준프레임워크 Boot 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 Boot Web Project > [프로젝트 정보 입력-Next] > Generate Example 체크 [Finish] (또는) \\ * 개발환경 > file > New > eGovframe Boot Web Project > [프로젝트 정보 입력-Next] > Generate Example 체크 [Finish] \\ {{:egovframework:dev4.2:dep:build_tool:gradle:buildship:gradle.sample.01.png|생성 프로젝트 선택}} \\ {{:egovframework:dev4.2:dep:build_tool:gradle:buildship:gradle.sample.02.png|프로젝트 정보 입력}} {{:egovframework:dev4.2:dep:build_tool:gradle:buildship:gradle.sample.03.png|게시판 컨텐츠 자동생성 체크}}\\ {{:egovframework:dev4.2:dep:build_tool:gradle:buildship:gradle.sample.04.png|메이븐 프로젝트 속성 확인}} \\ - build.gradle 파일 추가 * [[:egovframework:dev4.2:dep:build_tool:boot_togradle#build.gradle_파일|build.gradle]] \\ {{:egovframework:dev4.2:dep:build_tool:gradle:buildship:gradle.sample.05.png|파일생성}} \\ {{:egovframework:dev4.2:dep:build_tool:gradle:buildship:gradle.sample.06.png|파일명입력}} - 기존 Maven Nature 삭제 * Mavne > Disable Maven Nature \\ {{:egovframework:dev4.2:dep:build_tool:gradle:buildship:gradle.sample.07.png|Maven Nature 삭제}} {{:egovframework:dev4.2:dep:build_tool:gradle:buildship:gradle.sample.08.png|Compile 오류}} \\ - Gradle Nature 추가 * Configure > Add Gradle Nature \\ {{:egovframework:dev4.2:dep:build_tool:gradle:buildship:gradle.sample.09.png|Gradle Nature 추가}} {{:egovframework:dev4.2:dep:build_tool:gradle:buildship:gradle.sample.10.png|Compile 오류 정리}} \\ - pom.xml 삭제 - Gradle 설정 확인 * Gradle > Refresh Gradle Project \\ {{:egovframework:dev4.2:dep:build_tool:gradle:buildship:gradle.sample.11.png|Task 재구성}} \\ - Gradle Tasks View 열기 * Window > Show View > Gradle > Gradle Tasks \\ {{:egovframework:dev4.2:dep:build_tool:gradle:buildship:gradle.install14.png|}} \\ - Gradle Tasks View에 표시된 프로젝트 Build * 프로젝트에 구성된 Task를 시작메뉴를 이용하여 빌드실행 \\ {{:egovframework:dev4.2:dep:build_tool:gradle:buildship:gradle.sample.12.png|기본 Task 실행}} \\ {{:egovframework:dev4.2:dep:build_tool:gradle:buildship:gradle.sample.13.png|Task 실행결과}} \\ - Gradle 프로젝트 실행 * Run As > Spring Boot App {{:egovframework:dev4.2:dep:build_tool:gradle:buildship:gradleprjrun.png|}} ==== build.gradle 파일 ==== plugins { id 'java' id 'org.springframework.boot' version '2.7.12' id 'io.spring.dependency-management' version '1.1.4' } configurations { all { exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging' exclude group: 'org.springframework.boot', module: 'org.springframework.boot:spring-boot-starter-logging' } } group = 'egovframework' version = '1.0.0' java.sourceCompatibility = JavaVersion.VERSION_1_8 repositories { mavenCentral() maven { url 'https://maven.egovframe.go.kr/maven' } } dependencies { implementation 'org.springframework.boot:spring-boot-starter-web:2.7.12' implementation 'org.springframework.boot:spring-boot-starter-tomcat:2.7.12' implementation 'org.apache.tomcat.embed:tomcat-embed-jasper:9.0.63' implementation 'org.springframework.boot:spring-boot-starter-thymeleaf:2.7.12' implementation 'org.springframework.boot:spring-boot-starter-validation:2.7.12' developmentOnly 'org.springframework.boot:spring-boot-devtools:2.7.12' implementation ('org.egovframe.rte:org.egovframe.rte.ptl.mvc:4.2.0') { exclude group: 'commons-logging', module: 'commons-logging' } 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 'org.hsqldb:hsqldb:2.7.2:jdk8' implementation 'org.projectlombok:lombok:1.18.28' annotationProcessor 'org.projectlombok:lombok:1.18.28' testImplementation 'org.projectlombok:lombok:1.18.28' testAnnotationProcessor 'org.projectlombok:lombok:1.18.28' implementation 'org.hibernate:hibernate-entitymanager:5.6.15.Final' testImplementation 'org.springframework.boot:spring-boot-starter-test' } bootJar { exclude('org/projectlombok/lombok') } test { useJUnitPlatform() }