forked from kimhyungsik/ax_hub_mcp_tool
gradle 중복 제거 및 정비
This commit is contained in:
43
build.gradle
43
build.gradle
@@ -1,60 +1,88 @@
|
|||||||
|
// 루트 Gradle 설정: 모든 Gateway/Tool Pod 모듈이 공유하는 빌드 기준을 정의합니다.
|
||||||
plugins {
|
plugins {
|
||||||
|
// Java 컴파일, 테스트, JAR 생성 기능을 제공합니다.
|
||||||
id 'java'
|
id 'java'
|
||||||
id 'org.springframework.boot' version '4.0.5' apply false
|
|
||||||
|
// 하위 실행 모듈에서 bootRun/bootJar를 사용하기 위한 Spring Boot 플러그인입니다.
|
||||||
|
// 루트 프로젝트에는 적용하지 않으므로 apply false를 사용합니다.
|
||||||
|
id 'org.springframework.boot' version '3.5.11' apply false
|
||||||
|
|
||||||
|
// Spring Boot / Spring AI BOM에 정의된 라이브러리 버전을 일관되게 적용합니다.
|
||||||
id 'io.spring.dependency-management' version '1.1.6' apply false
|
id 'io.spring.dependency-management' version '1.1.6' apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 모든 모듈이 공유하는 Maven 식별자입니다.
|
||||||
allprojects {
|
allprojects {
|
||||||
group = 'io.shinhanlife'
|
group = 'io.shinhanlife'
|
||||||
version = '0.0.1-SNAPSHOT'
|
version = '0.0.1-SNAPSHOT'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// dap-gateway, dap-was-lib, dap-was-oth, dap-was-sms에 공통 적용합니다.
|
||||||
subprojects {
|
subprojects {
|
||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'io.spring.dependency-management'
|
apply plugin: 'io.spring.dependency-management'
|
||||||
|
|
||||||
java {
|
java {
|
||||||
|
// 프로젝트 표준 Java 버전입니다.
|
||||||
sourceCompatibility = '21'
|
sourceCompatibility = '21'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
// 현재 공개 정식 라이브러리 저장소입니다.
|
||||||
|
// 폐쇄망 적용 시 사내 Nexus Proxy URL로 교체합니다.
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url 'https://repo.spring.io/milestone' }
|
|
||||||
maven { url 'https://repo.spring.io/snapshot' }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencyManagement {
|
dependencyManagement {
|
||||||
imports {
|
imports {
|
||||||
|
// Spring Boot 3.5.11과 호환되는 Spring/Jackson/Tomcat 등의 버전을 관리합니다.
|
||||||
mavenBom org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES
|
mavenBom org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES
|
||||||
mavenBom "org.springframework.ai:spring-ai-bom:2.0.0"
|
|
||||||
|
// Spring AI, MCP, OpenAI 연동 라이브러리의 호환 버전을 1.1.8로 고정합니다.
|
||||||
|
mavenBom 'org.springframework.ai:spring-ai-bom:1.1.8'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
// Lombok은 컴파일 시 getter/builder 등 반복 코드를 생성하며 실행 JAR에는 포함하지 않습니다.
|
||||||
compileOnly 'org.projectlombok:lombok:1.18.32'
|
compileOnly 'org.projectlombok:lombok:1.18.32'
|
||||||
annotationProcessor 'org.projectlombok:lombok:1.18.32'
|
annotationProcessor 'org.projectlombok:lombok:1.18.32'
|
||||||
annotationProcessor 'org.projectlombok:lombok-mapstruct-binding:0.2.0'
|
testCompileOnly 'org.projectlombok:lombok:1.18.32'
|
||||||
|
testAnnotationProcessor 'org.projectlombok:lombok:1.18.32'
|
||||||
|
|
||||||
|
// Tool DTO와 MCI 요청/응답 객체 간 Converter 구현체를 컴파일 시 자동 생성합니다.
|
||||||
implementation 'org.mapstruct:mapstruct:1.5.5.Final'
|
implementation 'org.mapstruct:mapstruct:1.5.5.Final'
|
||||||
|
annotationProcessor 'org.projectlombok:lombok-mapstruct-binding:0.2.0'
|
||||||
annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.5.Final'
|
annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.5.Final'
|
||||||
|
|
||||||
|
// 모든 모듈의 JUnit 5 기반 테스트 공통 의존성입니다.
|
||||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile) {
|
||||||
|
// 리플렉션/MCP Schema 생성 시 메서드 파라미터명을 사용할 수 있도록 보존합니다.
|
||||||
options.compilerArgs << '-parameters'
|
options.compilerArgs << '-parameters'
|
||||||
|
|
||||||
|
// MapStruct 구현체를 Spring Bean으로 생성해 생성자 주입으로 사용할 수 있게 합니다.
|
||||||
options.compilerArgs << '-Amapstruct.defaultComponentModel=spring'
|
options.compilerArgs << '-Amapstruct.defaultComponentModel=spring'
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(Test) {
|
tasks.withType(Test) {
|
||||||
|
// JUnit 5 테스트 플랫폼을 사용합니다.
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Tool 이름 중복 검사 프로그램이 포함된 공통 라이브러리 모듈입니다.
|
||||||
def toolCoreProject = project(':dap-was-lib')
|
def toolCoreProject = project(':dap-was-lib')
|
||||||
|
|
||||||
|
// 전체 Tool Pod의 @McpTool(name) 중복을 배포 산출물 생성 전에 차단합니다.
|
||||||
tasks.register('validateMcpToolNames', JavaExec) {
|
tasks.register('validateMcpToolNames', JavaExec) {
|
||||||
group = 'verification'
|
group = 'verification'
|
||||||
description = 'Checks duplicate @McpFunction names across all Tool modules before packaging.'
|
description = 'Checks duplicate @McpTool names across all Tool modules before packaging.'
|
||||||
|
|
||||||
|
// 검사 Runner를 실행하기 전에 dap-was-lib 클래스를 먼저 컴파일합니다.
|
||||||
dependsOn toolCoreProject.tasks.named('classes')
|
dependsOn toolCoreProject.tasks.named('classes')
|
||||||
classpath = toolCoreProject.sourceSets.main.runtimeClasspath
|
classpath = toolCoreProject.sourceSets.main.runtimeClasspath
|
||||||
mainClass.set('io.shinhanlife.dap.lib.validation.McpToolNameValidationRunner')
|
mainClass.set('io.shinhanlife.dap.lib.validation.McpToolNameValidationRunner')
|
||||||
@@ -62,7 +90,8 @@ tasks.register('validateMcpToolNames', JavaExec) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
|
// 배포용 Spring Boot JAR 생성 전에 Tool 이름 중복 검증을 강제합니다.
|
||||||
tasks.matching { it.name == 'bootJar' }.configureEach {
|
tasks.matching { it.name == 'bootJar' }.configureEach {
|
||||||
dependsOn rootProject.tasks.named('validateMcpToolNames')
|
dependsOn rootProject.tasks.named('validateMcpToolNames')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user