plugins { id 'java-library' id 'maven-publish' id 'eclipse-wtp' id 'idea' id 'com.diffplug.eclipse.apt' version '3.41.1' } group 'com.eactive' version '4.5.1-SNAPSHOT' def nexusUrl = "https://nexus.eactive.synology.me:8090" def springVersion = "5.3.27" def queryDslVersion = "5.0.0" def hibernateVersion = "5.6.15.Final" def generatedJavaDir = "$buildDir/generated/java" 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' ] } } jar { exclude '**/persistence.xml' } tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } dependencies { // project > properties > Java Compiler > Annoation Processing 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" api project(':elink-online-core') compileOnly fileTree(dir: 'libs', include: ['*.jar']) api 'commons-collections:commons-collections:3.2.2' // poi-excelant -> poi-ooxml -> dom4j:dom4j:1.6.1 (구 groupId) 전이 차단. // 1.6.1 은 XXE(CVE-2020-10683) / XML 인젝션(CVE-2018-1000632) 대상이고, // 소스의 org.dom4j 사용처(HttpClient*AdapterServiceRest 등의 SAXReader)는 // hibernate-envers 가 가져오는 org.dom4j:dom4j:2.1.3 과 패키지가 같아 그대로 동작한다. // 두 jar 가 공존하면 WEB-INF/lib 로딩 순서에 따라 1.6.1 이 선택될 수 있으므로 제거한다. api ('org.apache.poi:poi-excelant:3.9') { exclude group: 'dom4j', module: 'dom4j' } api group: 'org.apache.commons', name: 'commons-pool2', version: '2.11.1' api 'commons-codec:commons-codec:1.15' // jackson-dataformat-xml(2.13.1) 을 jackson-databind 로 치환 (2026-08-27) // // XmlMapper/JacksonXml* 사용처는 전 소스에 0건이지만, 이 아티팩트가 transformer 의 // 유일한 jackson 공급원이었다(전이로 jackson-core/databind 2.13.1 을 끌고 옴). // 그런데 compileOnly 라 WAR 에는 안 들어가고, 런타임은 Ignite 가 끌고 오는 2.12.7 이다. // 이 컴파일(2.13.1)/런타임(2.12.7) skew 때문에 2.13 전용 API 가 컴파일을 통과했고, // 실제로 JacksonUtil.setValue() 가 ArrayNode.set(int, String)(2.13 신규)을 써서 // 배열 경로 setText() 시 NoSuchMethodError 가 나는 상태였다. // 런타임에 실제 존재하는 버전을 명시해 컴파일/런타임을 일치시킨다. api group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.12.7' compileOnly group: 'xalan', name: 'xalan', version: '2.6.0' api 'net.sf.j8583:j8583:1.18.0' // // //삼성페이 penta //api 'com.eactive:scphost:1.0' //api 'com.eactive:xdsp_java:1.0' //api 'com.eactive:jep-4.j18-md:1.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1' testRuntimeOnly 'com.h2database:h2:2.1.214' testImplementation 'org.springframework.boot:spring-boot-starter-test:2.6.15' testImplementation 'org.junit.platform:junit-platform-suite-api:1.8.2' testImplementation 'org.junit.platform:junit-platform-launcher:1.8.2' //testImplementation files("libs/json-simple-1.1.1-custom-1.2.jar") //testImplementation files("libs/jep-4.j18-md-1.0.jar") testImplementation fileTree(dir: 'libs', include: ['*.jar']) testImplementation 'junit:junit:4.4' } test { useJUnitPlatform() // TransformEngine/LayoutManager/MessageFactory 는 ApplicationContextProvider 기반의 // JVM 전역 싱글턴이다. 한 JVM 에서 여러 테스트 클래스를 돌리면 마지막에 뜬 스프링 // 컨텍스트가 앞선 컨텍스트를 덮어써서, 뒤 클래스가 앞 클래스의 레이아웃을 보게 된다 // ("cannot create message" 오류). 클래스마다 JVM 을 새로 띄워 격리한다. forkEvery = 1 // 클래스별 JVM 분리로 느려지는 것을 CPU 코어 수만큼 병렬 실행해 상쇄한다. // 포크마다 별도 JVM(=별도 H2 인메모리 DB)이라 서로 간섭하지 않는다. maxParallelForks = Math.max(1, Runtime.runtime.availableProcessors().intdiv(2)) } publishing { repositories { maven { name = 'eactiveRepository' def releasesRepoUrl = "${nexusUrl}/repository/maven-releases/" def snapshotsRepoUrl = "${nexusUrl}/repository/maven-snapshots/" url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl credentials(PasswordCredentials) } } publications { mavenJava(MavenPublication) { from components.java pom { description = "eLink Transformer module" licenses { license { name = "Commercial License" url = "http://eactive.co.kr" } } } } } } task sourcesJar(type: Jar, dependsOn: classes) { archiveClassifier = 'sources' from sourceSets.main.allSource } artifacts { archives sourcesJar } configurations.all { resolutionStrategy { // 동적 버전 탐색을 10분 캐시 cacheDynamicVersionsFor 10, 'minutes' // 변하는 모듈(Changing Module)을 캐시하지 않음 cacheChangingModulesFor 0, 'seconds' } } 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') } } task initDirs() { file(generatedJavaDir).mkdirs() } eclipse { 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' } }