plugins { id 'java-library' id 'eclipse-wtp' id 'idea' id 'groovy' id 'war' id 'com.diffplug.eclipse.apt' version '3.41.1' } group 'com.eactvie' //version '4.5.7' def springVersion = "5.3.27" //def springSecurityVersion = '4.2.13.RELEASE' def springSecurityVersion = '5.7.11' def springOauth2Version = '2.3.8.RELEASE' def quartzVersion = "2.3.2" def undertowVersion = "1.4.28.Final" def queryDslVersion = "5.0.0" def hibernateVersion = "5.6.15.Final" def generatedJavaDir = "$buildDir/generated/java" def nexusUrl = "https://nexus.eactive.synology.me:8090" allprojects { repositories { maven { url "${nexusUrl}/repository/maven-public/" allowInsecureProtocol = true } } } java { toolchain { languageVersion = JavaLanguageVersion.of(8) } } compileJava { options.encoding = 'UTF-8' sourceSets.main.java { srcDir generatedJavaDir } options.generatedSourceOutputDirectory = project.file(generatedJavaDir) aptOptions { processorArgs = [ 'querydsl.generatedAnnotationClass' : 'com.querydsl.core.annotations.Generated' ] } } war { // 2025.10.13 - weblogic 대응 (weblogic-web.xml -> web.xml 강제 사용) def profile = project.findProperty("profile") ?: "tomcat" if (profile == "weblogic") { webXml = file("WebContent/WEB-INF/weblogic-web.xml") exclude 'WEB-INF/web.xml' } archiveFileName = "eapim-online.war" duplicatesStrategy = DuplicatesStrategy.WARN exclude '**/persistence.xml' exclude '**/context.xml' } tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } dependencies { annotationProcessor "org.projectlombok:lombok:1.18.28", "org.projectlombok:lombok-mapstruct-binding:0.2.0", "org.mapstruct:mapstruct-processor:1.5.5.Final" annotationProcessor "com.querydsl:querydsl-apt:${queryDslVersion}:jpa", "jakarta.persistence:jakarta.persistence-api:2.2.3", "jakarta.annotation:jakarta.annotation-api:1.3.5" // implementation ('com.eactive:elink-online-core:4.5-SNAPSHOT') { changing = true } // implementation ('com.eactive:elink-online-transformer:4.5-SNAPSHOT') { changing = true } // implementation ('com.eactive:elink-online-common:4.5-SNAPSHOT') { changing = true } // implementation ('com.eactive:elink-online-emsclient:4.5-SNAPSHOT') { changing = true } implementation project(':elink-online-core') implementation project(':elink-online-transformer') implementation project(':elink-online-common') implementation project(':elink-online-emsclient') implementation fileTree(dir: 'libs', include: ['*.jar']) // implementation 'org.xerial:sqlite-jdbc:3.39.2.1' /* mina-filter-ssl에 Exclude 설정을 하였으나 mina-integration-spring에서도 mina-filter-ssl을 참조하여 해당 "mina-filter-ssl" 참조관계로 인해 ".apache.mina:mina-core:1.0.10"가 참조되는 일이 발생하여 두 라이브러르 모두 "exclude group" 설정을 추가함 아래의 configurations 처럼 ALL로 제거하여도 무방함 참고 configurations { all*.exclude group: 'org.apache.mina', module:'mina-core' } */ implementation ("org.apache.mina:mina-filter-ssl:1.0.10"){ exclude group: 'org.apache.mina' } implementation ('org.apache.mina:mina-integration-spring:1.0.10'){ exclude group: 'org.apache.mina' } //implementation 'com.eactive:java_websocket-custom:1.0' //implementation "tmax:webt:7.0.2.0-r11661-forJEUS8.0" //implementation "tmax:webtasync:2.0.3.1-r11801-forJEUS8.1" implementation 'org.graylog2:gelfj:1.1.16' implementation "org.springframework:spring-webmvc:${springVersion}" implementation "org.springframework.security:spring-security-jwt:1.1.1.RELEASE" //implementation "com.eactive:ojdbc8:1.0" //implementation "org.postgresql:postgresql:42.2.23" implementation 'org.mariadb.jdbc:mariadb-java-client:2.7.4' //implementation "com.oracle.ojdbc:ojdbc8:19.3.0.0" implementation 'org.slf4j:jul-to-slf4j:1.7.35' implementation 'org.slf4j:jcl-over-slf4j:1.7.35' implementation 'org.slf4j:log4j-over-slf4j:1.7.35' implementation 'org.slf4j:slf4j-api:1.7.35' implementation 'co.elastic.logging:logback-ecs-encoder:1.5.0' implementation 'net.sf.j8583:j8583:1.18.0' runtimeOnly 'net.minidev:json-smart:2.4.11' testRuntimeOnly 'com.h2database:h2:2.1.214' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1' testImplementation 'org.springframework.boot:spring-boot-starter-test:2.6.15' testImplementation 'junit:junit:4.4' } configurations.all { resolutionStrategy { force 'org.slf4j:slf4j-api:1.7.36' // slf4j-api를 강제로 1.7.36으로 고정 } } project.webAppDirName = 'WebContent' test { useJUnitPlatform() } //configurations.all { // resolutionStrategy { // // 동적 버전 탐색을 10분 캐시 // cacheDynamicVersionsFor 10, 'minutes' // // 변하는 모듈(Changing Module)을 캐시하지 않음 // cacheChangingModulesFor 0, 'seconds' // } //} configurations.all { exclude group: 'log4j', module: 'log4j' exclude group: 'org.codehaus.jackson' } task settingEclipseEncoding { if (project.file('.settings').exists()) { File f = file('.settings/org.eclipse.core.resources.prefs') f.write('eclipse.preferences.version=1\n') f.append('encoding/=utf-8') } } //eclipseJdt.finalizedBy settingEclipseEncoding task initDirs() { file(generatedJavaDir).mkdirs() } // version.info 를 classpath 리소스로 생성해 WAR의 WEB-INF/classes에 포함시킨다. // elink-online-common 등 공유 라이브러리 모듈이 아니라, 실제 배포 아티팩트(eapim-online.war)를 // 만드는 이 루트 프로젝트에서 생성해야 "지금 배포된 게이트웨이가 정확히 어느 커밋인지"를 // eapim-online 소스 변경 여부와 무관하게 항상 최신으로 반영한다. // ToolsController(/manage/tools/version, elink-online-common 모듈)는 이 파일을 // Class.getResourceAsStream("/version.info")로 읽는데, WAR는 WEB-INF/classes와 // WEB-INF/lib 전체가 하나의 클래스로더를 공유하므로 어느 모듈의 클래스에서 조회하든 찾을 수 있다. // // elink-online-common/elink-online-core/... 는 별도 저장소를 참조하는 git submodule이라 // 루트(eapim-online)의 describe/dirty 만으로는 "어느 서브모듈이 바뀌었는지"를 알 수 없다 // (서브모듈 포인터가 커밋되고 나면 루트는 다시 clean 해져서 -dirty 흔적도 사라진다). // 그래서 서브모듈 각각에 대해서도 describe를 실행해 module.<이름>=<결과> 형식으로 함께 기록한다. def describeGit(File dir) { try { def proc = "git describe --tags --always --dirty".execute(null, dir) // proc.text는 JVM/OS 기본 charset(Windows 환경에선 CP949 등)으로 stdout을 디코딩한다. // git 태그명은 UTF-8 바이트이므로 기본 charset이 UTF-8이 아니면 여기서 한글이 깨진다. // stream을 명시적으로 UTF-8로 읽어서 이 문제를 피한다. def output = proc.inputStream.getText("UTF-8") proc.waitFor() return (proc.exitValue() == 0) ? output.trim() : "unknown" } catch (Exception e) { logger.warn("${dir} git describe 실행 불가, unknown 으로 대체: ${e.message}") return "unknown" } } task generateVersionInfo { doLast { def gitVersion = describeGit(projectDir) def sb = new StringBuilder() sb.append("version=${gitVersion}\n") sb.append("buildTime=${new Date().format("yyyy-MM-dd HH:mm:ss")}\n") subprojects.sort { it.name }.each { sub -> if (file("${sub.projectDir}/.git").exists()) { sb.append("module.${sub.name}=${describeGit(sub.projectDir)}\n") } } def versionInfoFile = file("$projectDir/src/main/resources/version.info") versionInfoFile.parentFile.mkdirs() versionInfoFile.write(sb.toString(), "UTF-8") } } processResources.dependsOn generateVersionInfo eclipse { wtp { component { contextPath = '/' } } synchronizationTasks settingEclipseEncoding, initDirs jdt { apt { // generated 된 패스 경로를 .setting/org.eclipse.jdt.apt.core.prefs 의 org.eclipse.jdt.apt.genSrcDir에 적용한다. // project > properties > Java Compiler > Annoation Processing 화면에서 확인 가능하다. genSrcDir = file(generatedJavaDir) } } project { natures = ['org.eclipse.buildship.core.gradleprojectnature', 'org.eclipse.jdt.core.javanature', 'org.eclipse.wst.common.project.facet.core.nature', 'org.eclipse.wst.common.modulecore.ModuleCoreNature', 'org.eclipse.jem.workbench.JavaEMFNature'] buildCommand 'org.eclipse.buildship.core.gradleprojectbuilder' buildCommand 'org.eclipse.wst.validation.validationbuilder' buildCommand 'org.eclipse.wst.common.project.facet.core.builder' buildCommand 'org.eclipse.jdt.core.javabuilder' } }