// API Gateway 모듈 // 루트 build.gradle의 subprojects 블록에서 공통 설정 적용됨 // API Gateway는 WebFlux를 사용하므로 일부 다른 설정 필요 // Spring Cloud 버전 정의 ext { set('springCloudVersion', '2023.0.0') } dependencies { // Common module dependency (exclude WebMVC, Security, and non-reactive Redis for WebFlux) implementation(project(':common')) { exclude group: 'org.springframework.boot', module: 'spring-boot-starter-web' exclude group: 'org.springframework.boot', module: 'spring-boot-starter-security' exclude group: 'org.springframework.boot', module: 'spring-boot-starter-data-jpa' exclude group: 'org.springframework.boot', module: 'spring-boot-starter-data-redis' } // Spring Cloud Gateway (api-gateway specific) implementation 'org.springframework.cloud:spring-cloud-starter-gateway' // Redis for health checks and caching implementation 'org.springframework.boot:spring-boot-starter-data-redis-reactive' // Circuit Breaker (api-gateway specific) implementation 'org.springframework.cloud:spring-cloud-starter-circuitbreaker-reactor-resilience4j' // Monitoring (api-gateway specific) implementation 'io.micrometer:micrometer-registry-prometheus' // Logging (api-gateway specific) implementation 'net.logstash.logback:logstash-logback-encoder:7.4' // Netty macOS DNS resolver (api-gateway specific) implementation 'io.netty:netty-resolver-dns-native-macos:4.1.100.Final:osx-aarch_64' // Test Dependencies (api-gateway specific) testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' } dependencyManagement { imports { mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}" } } // 추가 테스트 설정 (루트에서 기본 설정됨) tasks.named('test') { systemProperty 'spring.profiles.active', 'test' } // JAR 파일명 설정 jar { archiveBaseName = 'api-gateway' enabled = false } bootJar { archiveFileName = 'api-gateway.jar' // 빌드 정보 추가 manifest { attributes( 'Implementation-Title': 'PhoneBill API Gateway', 'Implementation-Version': "${version}", 'Built-By': System.getProperty('user.name'), 'Built-JDK': System.getProperty('java.version'), 'Build-Time': new Date().format('yyyy-MM-dd HH:mm:ss') ) } } // 개발 환경 실행 설정 if (project.hasProperty('dev')) { bootRun { systemProperty 'spring.profiles.active', 'dev' jvmArgs = ['-Dspring.devtools.restart.enabled=true'] } } // 프로덕션 환경 실행 설정 if (project.hasProperty('prod')) { bootRun { systemProperty 'spring.profiles.active', 'prod' jvmArgs = [ '-server', '-Xms512m', '-Xmx1024m', '-XX:+UseG1GC', '-XX:G1HeapRegionSize=16m', '-XX:+UseStringDeduplication', '-XX:+OptimizeStringConcat' ] } }