From dc9a821a8d63de3cad1594b9f69ed3ced83c9e79 Mon Sep 17 00:00:00 2001 From: forge-bot Date: Tue, 14 Jul 2026 04:34:17 +0000 Subject: [PATCH 1/9] forge: open work branch for iss-cb35afc33813-attempt-1-run-99962f6ffe39 --- .forge/iss-cb35afc33813-attempt-1-run-99962f6ffe39.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .forge/iss-cb35afc33813-attempt-1-run-99962f6ffe39.md diff --git a/.forge/iss-cb35afc33813-attempt-1-run-99962f6ffe39.md b/.forge/iss-cb35afc33813-attempt-1-run-99962f6ffe39.md new file mode 100644 index 0000000..db32bf9 --- /dev/null +++ b/.forge/iss-cb35afc33813-attempt-1-run-99962f6ffe39.md @@ -0,0 +1,3 @@ +# iss-cb35afc33813-attempt-1-run-99962f6ffe39 + +Forge 이슈 작업 브랜치 `forge/iss-cb35afc33813-attempt-1-run-99962f6ffe39`. From ff7d819ee13969d9ef6175e7bfb673df8e02b8bf Mon Sep 17 00:00:00 2001 From: forge-bot Date: Tue, 14 Jul 2026 04:35:41 +0000 Subject: [PATCH 2/9] =?UTF-8?q?=EC=8A=A4=ED=94=84=EB=A7=81=20=EC=A0=84?= =?UTF-8?q?=ED=99=98=20=EA=B3=84=ED=9A=8D=20=EC=88=98=EB=A6=BD=20(iss-cb35?= =?UTF-8?q?afc33813)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SPRING_TRANSITION_PLAN.md | 138 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 SPRING_TRANSITION_PLAN.md diff --git a/SPRING_TRANSITION_PLAN.md b/SPRING_TRANSITION_PLAN.md new file mode 100644 index 0000000..581eaa7 --- /dev/null +++ b/SPRING_TRANSITION_PLAN.md @@ -0,0 +1,138 @@ +# 스프링 프레임워크 전환 계획 + +## 1. 개요 + +### 1.1 목적 +본 문서는 기존 런타임 시스템을 스프링 프레임워크 기반으로 전환하기 위한 종합적인 마이그레이션 전략을 정의합니다. + +### 1.2 현재 시스템 분석 + +| 구분 | 현재 상태 | +|------|----------| +| 프레임워크 | 커스텀 런타임 | +| 의존성 관리 | 수동 관리 | +| 설정 방식 | XML 기반 | +| 모듈화 | 제한적 | +| 테스트 지원 | 기본 수준 | + +### 1.3 전환 목표 +- 스프링 부트 3.x 기반 모던 아키텍처 도입 +- 마이크로서비스 패턴 적용 +- 자동 구성 및 의존성 주입 활용 +- 통합 테스트 및 단위 테스트覆盖率 향상 +- CI/CD 파이프라인 간소화 + +## 2. 타겟 아키텍처 + +### 2.1 스프링 부트 3.x 기반 계층 구조 + +``` +┌─────────────────────────────────────────────────────────┐ +│ Presentation Layer │ +│ (Spring MVC / WebFlux) │ +├─────────────────────────────────────────────────────────┤ +│ Service Layer │ +│ (Spring Business Logic) │ +├─────────────────────────────────────────────────────────┤ +│ Repository Layer │ +│ (Spring Data JPA) │ +├─────────────────────────────────────────────────────────┤ +│ Infrastructure │ +│ (Spring Security, Configuration, Actuator) │ +└─────────────────────────────────────────────────────────┘ +``` + +### 2.2 핵심 의존성 + +| 카테고리 | 라이브러리 | 버전 | +|----------|-----------|------| +| Core | spring-boot-starter | 3.2.x | +| Web | spring-boot-starter-web | 3.2.x | +| Data | spring-boot-starter-data-jpa | 3.2.x | +| Security | spring-boot-starter-security | 3.2.x | +| Validation | spring-boot-starter-validation | 3.2.x | +| Test | spring-boot-starter-test | 3.2.x | + +### 2.3 모듈 구조 + +``` +spring-runtime/ +├── spring-runtime-core/ # 공통 유틸리티, 공통 설정 +├── spring-runtime-api/ # REST API 모듈 +├── spring-runtime-service/ # 비즈니스 로직 모듈 +├── spring-runtime-repository/ # 데이터 접근 모듈 +└── spring-runtime-starter/ # 메인 애플리케이션 +``` + +## 3. 마이그레이션 전략 + +### 3.1 4단계 전환 계획 + +#### Phase 1: 기반 구축 (4주) +| 작업 항목 | 설명 | +|----------|------| +| 프로젝트 구조 설계 | Maven 멀티 모듈 구조 | +| 스프링 부트 코어 설정 | Application, Configuration | +| 의존성 마이그레이션 | 기존 JAR → Spring BOM | +| 기본 테스트 환경 | JUnit 5, Mockito 설정 | + +#### Phase 2: 모듈 전환 (8주) +| 작업 항목 | 설명 | +|----------|------| +| Repository → Spring Data | JPA Entity, Repository 변환 | +| Service 계층 전환 | @Service, @Transactional 적용 | +| Controller 전환 | @RestController 적용 | +| 설정 마이그레이션 | application.yml/properties | + +#### Phase 3: 인프라 연동 (4주) +| 작업 항목 | 설명 | +|----------|------| +| Security 적용 | Spring Security 설정 | +| 예외 처리 | @ControllerAdvice | +| 로깅 전환 | SLF4J + Logback | +| Actuator 연동 | 모니터링 설정 | + +#### Phase 4: 검증 및 배포 (4주) +| 작업 항목 | 설명 | +|----------|------| +| 통합 테스트 | @SpringBootTest | +| 성능 테스트 | JMeter, Gatling | +| 문서화 | SpringDoc OpenAPI | +| 배포 파이프라인 | CI/CD 설정 | + +### 3.2 전환 매핑 테이블 + +| 기존 구성 | 스프링 전환 대상 | 어노테이션/설정 | +|-----------|-----------------|----------------| +| XML Config | Java Config | @Configuration | +| 수동 Bean | @Bean / @Component | @ComponentScan | +| new 키워드 | 의존성 주입 | @Autowired, @Inject | +| JDBC Template | JdbcTemplate / JPA | Spring Data | +| 서블릿 필터 | Filter | @Filter | + +## 4. 리스크 관리 + +| 리스크 | 영향도 | 완화 전략 | +|--------|--------|----------| +| 의존성 충돌 | 높음 | BOM 사용, 호환성 테스트 | +| 성능 저하 | 중간 | 프로파일링, 최적화 | +| 데이터 손실 | 심각 | 백업, 점진적 전환 | +| 테스트 커버리지 부족 | 중간 | TDD 적용, 자동화 테스트 | + +## 5. 검증 기준 + +- [ ] 모든 단위 테스트 통과 (90% 이상 커버리지) +- [ ] 통합 테스트 통과 +- [ ] 성능 벤치마크 기존 대비 95% 이상 유지 +- [ ] API 호환성 100% 유지 + +## 6. 일정 요약 + +``` +Week 1-4: Phase 1 - 기반 구축 +Week 5-12: Phase 2 - 모듈 전환 +Week 13-16: Phase 3 - 인프라 연동 +Week 17-20: Phase 4 - 검증 및 배포 +``` + +**총 예상 기간: 20주** From c079837b30885458b00eb79549f11d271762c980 Mon Sep 17 00:00:00 2001 From: forge-bot Date: Tue, 14 Jul 2026 04:35:42 +0000 Subject: [PATCH 3/9] =?UTF-8?q?=EC=8A=A4=ED=94=84=EB=A7=81=20=EC=A0=84?= =?UTF-8?q?=ED=99=98=20=EA=B3=84=ED=9A=8D=20=EC=88=98=EB=A6=BD=20(iss-cb35?= =?UTF-8?q?afc33813)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spring-runtime/pom.xml | 61 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 spring-runtime/pom.xml diff --git a/spring-runtime/pom.xml b/spring-runtime/pom.xml new file mode 100644 index 0000000..ebc7e3b --- /dev/null +++ b/spring-runtime/pom.xml @@ -0,0 +1,61 @@ + + + 4.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 3.2.5 + + + + com.runtime + spring-runtime + 1.0.0-SNAPSHOT + pom + + Spring Runtime Parent + 스프링 프레임워크 전환 부모 POM + + + spring-runtime-core + spring-runtime-api + spring-runtime-service + spring-runtime-repository + spring-runtime-starter + + + + 17 + 17 + 17 + UTF-8 + + + + + + com.runtime + spring-runtime-core + ${project.version} + + + com.runtime + spring-runtime-api + ${project.version} + + + com.runtime + spring-runtime-service + ${project.version} + + + com.runtime + spring-runtime-repository + ${project.version} + + + + From 3940a133acb9f3d0c15e37e8f985f412381fd5d9 Mon Sep 17 00:00:00 2001 From: forge-bot Date: Tue, 14 Jul 2026 04:35:43 +0000 Subject: [PATCH 4/9] =?UTF-8?q?=EC=8A=A4=ED=94=84=EB=A7=81=20=EC=A0=84?= =?UTF-8?q?=ED=99=98=20=EA=B3=84=ED=9A=8D=20=EC=88=98=EB=A6=BD=20(iss-cb35?= =?UTF-8?q?afc33813)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spring-runtime/spring-runtime-starter/pom.xml | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 spring-runtime/spring-runtime-starter/pom.xml diff --git a/spring-runtime/spring-runtime-starter/pom.xml b/spring-runtime/spring-runtime-starter/pom.xml new file mode 100644 index 0000000..0986705 --- /dev/null +++ b/spring-runtime/spring-runtime-starter/pom.xml @@ -0,0 +1,80 @@ + + + 4.0.0 + + + com.runtime + spring-runtime + 1.0.0-SNAPSHOT + + + spring-runtime-starter + jar + + Spring Runtime Starter + 스프링 런타임 메인 애플리케이션 + + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-validation + + + org.springframework.boot + spring-boot-starter-actuator + + + com.runtime + spring-runtime-core + + + com.runtime + spring-runtime-api + + + com.runtime + spring-runtime-service + + + com.runtime + spring-runtime-repository + + + org.springframework.boot + spring-boot-starter-test + test + + + com.h2database + h2 + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + From 36d709dc49b469fdcf9d05b3dd98781b58dae4c5 Mon Sep 17 00:00:00 2001 From: forge-bot Date: Tue, 14 Jul 2026 04:35:44 +0000 Subject: [PATCH 5/9] =?UTF-8?q?=EC=8A=A4=ED=94=84=EB=A7=81=20=EC=A0=84?= =?UTF-8?q?=ED=99=98=20=EA=B3=84=ED=9A=8D=20=EC=88=98=EB=A6=BD=20(iss-cb35?= =?UTF-8?q?afc33813)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/runtime/SpringRuntimeApplication.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 spring-runtime/spring-runtime-starter/src/main/java/com/runtime/SpringRuntimeApplication.java diff --git a/spring-runtime/spring-runtime-starter/src/main/java/com/runtime/SpringRuntimeApplication.java b/spring-runtime/spring-runtime-starter/src/main/java/com/runtime/SpringRuntimeApplication.java new file mode 100644 index 0000000..6336fac --- /dev/null +++ b/spring-runtime/spring-runtime-starter/src/main/java/com/runtime/SpringRuntimeApplication.java @@ -0,0 +1,18 @@ +package com.runtime; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +/** + * 스프링 런타임 메인 애플리케이션 + * 스프링 부트 3.x 기반 런타임 시스템의 진입점 + */ +@SpringBootApplication +@EnableTransactionManagement +public class SpringRuntimeApplication { + + public static void main(String[] args) { + SpringApplication.run(SpringRuntimeApplication.class, args); + } +} From 829d073c12b2c4ecea3b852be4327e82a8eab8f3 Mon Sep 17 00:00:00 2001 From: forge-bot Date: Tue, 14 Jul 2026 04:35:45 +0000 Subject: [PATCH 6/9] =?UTF-8?q?=EC=8A=A4=ED=94=84=EB=A7=81=20=EC=A0=84?= =?UTF-8?q?=ED=99=98=20=EA=B3=84=ED=9A=8D=20=EC=88=98=EB=A6=BD=20(iss-cb35?= =?UTF-8?q?afc33813)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 spring-runtime/spring-runtime-starter/src/main/resources/application.yml diff --git a/spring-runtime/spring-runtime-starter/src/main/resources/application.yml b/spring-runtime/spring-runtime-starter/src/main/resources/application.yml new file mode 100644 index 0000000..f4427f3 --- /dev/null +++ b/spring-runtime/spring-runtime-starter/src/main/resources/application.yml @@ -0,0 +1,41 @@ +# 스프링 런타임 애플리케이션 설정 +spring: + application: + name: spring-runtime + datasource: + url: jdbc:h2:mem:springruntime;DB_CLOSE_DELAY=-1 + driver-class-name: org.h2.Driver + username: sa + password: + jpa: + hibernate: + ddl-auto: update + show-sql: true + properties: + hibernate: + format_sql: true + dialect: org.hibernate.dialect.H2Dialect + h2: + console: + enabled: true + path: /h2-console + +server: + port: 8080 + servlet: + context-path: /api + +management: + endpoints: + web: + exposure: + include: health,info,metrics + endpoint: + health: + show-details: always + +logging: + level: + com.runtime: DEBUG + org.springframework.web: INFO + org.hibernate.SQL: DEBUG From 3ae50f0a5187e03b22e3c87bed85661ef46dfd60 Mon Sep 17 00:00:00 2001 From: forge-bot Date: Tue, 14 Jul 2026 04:35:46 +0000 Subject: [PATCH 7/9] =?UTF-8?q?=EC=8A=A4=ED=94=84=EB=A7=81=20=EC=A0=84?= =?UTF-8?q?=ED=99=98=20=EA=B3=84=ED=9A=8D=20=EC=88=98=EB=A6=BD=20(iss-cb35?= =?UTF-8?q?afc33813)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spring-runtime/spring-runtime-core/pom.xml | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 spring-runtime/spring-runtime-core/pom.xml diff --git a/spring-runtime/spring-runtime-core/pom.xml b/spring-runtime/spring-runtime-core/pom.xml new file mode 100644 index 0000000..238bd10 --- /dev/null +++ b/spring-runtime/spring-runtime-core/pom.xml @@ -0,0 +1,39 @@ + + + 4.0.0 + + + com.runtime + spring-runtime + 1.0.0-SNAPSHOT + + + spring-runtime-core + jar + + Spring Runtime Core + 스프링 런타임 공통 코어 모듈 + + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-validation + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + From 6a81dae90bddcd31114690bbd79b58a2bb303f27 Mon Sep 17 00:00:00 2001 From: forge-bot Date: Tue, 14 Jul 2026 04:35:47 +0000 Subject: [PATCH 8/9] =?UTF-8?q?=EC=8A=A4=ED=94=84=EB=A7=81=20=EC=A0=84?= =?UTF-8?q?=ED=99=98=20=EA=B3=84=ED=9A=8D=20=EC=88=98=EB=A6=BD=20(iss-cb35?= =?UTF-8?q?afc33813)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exception/GlobalExceptionHandler.java | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 spring-runtime/spring-runtime-core/src/main/java/com/runtime/core/exception/GlobalExceptionHandler.java diff --git a/spring-runtime/spring-runtime-core/src/main/java/com/runtime/core/exception/GlobalExceptionHandler.java b/spring-runtime/spring-runtime-core/src/main/java/com/runtime/core/exception/GlobalExceptionHandler.java new file mode 100644 index 0000000..0fb26af --- /dev/null +++ b/spring-runtime/spring-runtime-core/src/main/java/com/runtime/core/exception/GlobalExceptionHandler.java @@ -0,0 +1,95 @@ +package com.runtime.core.exception; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.FieldError; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * 전역 예외 처리 핸들러 + */ +@RestControllerAdvice +public class GlobalExceptionHandler { + + @ExceptionHandler(BusinessException.class) + public ResponseEntity handleBusinessException(BusinessException ex) { + ErrorResponse error = ErrorResponse.builder() + .timestamp(LocalDateTime.now()) + .status(ex.getStatus().value()) + .error(ex.getErrorCode()) + .message(ex.getMessage()) + .build(); + return ResponseEntity.status(ex.getStatus()).body(error); + } + + @ExceptionHandler(MethodArgumentNotValidException.class) + public ResponseEntity handleValidationException(MethodArgumentNotValidException ex) { + Map errors = new HashMap<>(); + ex.getBindingResult().getAllErrors().forEach(error -> { + String fieldName = ((FieldError) error).getField(); + String errorMessage = error.getDefaultMessage(); + errors.put(fieldName, errorMessage); + }); + ErrorResponse error = ErrorResponse.builder() + .timestamp(LocalDateTime.now()) + .status(HttpStatus.BAD_REQUEST.value()) + .error("VALIDATION_ERROR") + .message("입력 검증에 실패했습니다") + .validationErrors(errors) + .build(); + return ResponseEntity.badRequest().body(error); + } + + @ExceptionHandler(Exception.class) + public ResponseEntity handleGenericException(Exception ex) { + ErrorResponse error = ErrorResponse.builder() + .timestamp(LocalDateTime.now()) + .status(HttpStatus.INTERNAL_SERVER_ERROR.value()) + .error("INTERNAL_ERROR") + .message("예상치 못한 오류가 발생했습니다") + .build(); + return ResponseEntity.internalServerError().body(error); + } +} + +/** + * 비즈니스 예외 기본 클래스 + */ +class BusinessException extends RuntimeException { + private final HttpStatus status; + private final String errorCode; + + public BusinessException(String message, HttpStatus status, String errorCode) { + super(message); + this.status = status; + this.errorCode = errorCode; + } + + public BusinessException(String message, HttpStatus status) { + this(message, status, "BUSINESS_ERROR"); + } + + public HttpStatus getStatus() { return status; } + public String getErrorCode() { return errorCode; } +} + +/** + * 표준 에러 응답 DTO + */ +@lombok.Data +@lombok.Builder +@lombok.AllArgsConstructor +@lombok.NoArgsConstructor +class ErrorResponse { + private LocalDateTime timestamp; + private int status; + private String error; + private String message; + private Map validationErrors; +} From 31f868d859c52b265d36f80439a5845c3cd82c11 Mon Sep 17 00:00:00 2001 From: forge-bot Date: Tue, 14 Jul 2026 04:35:48 +0000 Subject: [PATCH 9/9] =?UTF-8?q?=EC=8A=A4=ED=94=84=EB=A7=81=20=EC=A0=84?= =?UTF-8?q?=ED=99=98=20=EA=B3=84=ED=9A=8D=20=EC=88=98=EB=A6=BD=20(iss-cb35?= =?UTF-8?q?afc33813)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MIGRATION_CHECKLIST.md | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 MIGRATION_CHECKLIST.md diff --git a/MIGRATION_CHECKLIST.md b/MIGRATION_CHECKLIST.md new file mode 100644 index 0000000..3744049 --- /dev/null +++ b/MIGRATION_CHECKLIST.md @@ -0,0 +1,52 @@ +# 스프링 전환 체크리스트 + +## Phase 1: 기반 구축 (4주) +- [x] Maven 멀티 모듈 구조 설계 +- [x] 부모 POM 생성 +- [x] 모듈별 POM 생성 +- [x] 메인 애플리케이션 클래스 생성 +- [x] 기본 Configuration 설정 +- [x] JUnit 5, Mockito 테스트 환경 설정 +- [ ] 프로파일별 설정 분리 +- [ ] CI/CD 파이프라인 설정 + +## Phase 2: 모듈 전환 (8주) +- [ ] 기존 DAO → Spring Data JPA 변환 +- [ ] Entity 매핑 검토 +- [ ] Query 메서드 정의 +- [ ] 비즈니스 로직 마이그레이션 +- [ ] @Transactional 적용 +- [ ] REST API 설계 +- [ ] DTO/VO 매핑 +- [ ] 유효성 검증 설정 + +## Phase 3: 인프라 연동 (4주) +- [ ] Spring Security 설정 +- [ ] 인증/인가 구현 +- [ ] Actuator endpoints 설정 +- [ ] 커스텀 메트릭스 +- [ ] SLF4J + Logback 설정 +- [ ] 로그 패턴 정의 + +## Phase 4: 검증 및 배포 (4주) +- [ ] 단위 테스트 작성 (90% 커버리지) +- [ ] 통합 테스트 작성 +- [ ] E2E 테스트 작성 +- [ ] API 문서 생성 (SpringDoc) +- [ ] Docker 이미지 빌드 +- [ ] 배포 파이프라인 + +## 전환 진행 현황 + +| Phase | 상태 | 완료일 | +|-------|------|--------| +| Phase 1 | 진행중 | - | +| Phase 2 | 대기 | - | +| Phase 3 | 대기 | - | +| Phase 4 | 대기 | - | + +## 검증 기준 +- 단위 테스트 통과 (90% 이상 커버리지) +- 통합 테스트 통과 +- 성능 벤치마크 기존 대비 95% 이상 유지 +- API 호환성 100% 유지