728x90

When mutil-module project set up, some issues comes up like this. Let's show example.

 

We have three module like Entity, Cloud Server and Wep API. Cloud Server imports Entity module and also Web API module import that. 

 

 

MonaEvCloudServer

group = 'kr.ksmartech.ev'
version = '1.0-SNAPSHOT'

dependencies {
	...
    implementation project(":MonaEvEntity")
    
    ...
}

 

MonaEvEntity - it was only imported role. 

group = 'kr.ksmartech.ev.entity'
version = 'unspecified'

 

MonaEvApi - Non-Fixed version

group = 'kr.ksmartech.ev.web.api'
version = "1.0-API-SNAPSHOT"

dependencies {
    ...
    
    implementation project(":MonaEvEntity")
  
    ...

}

 

EvCloudServer and EvEntity would not be a collision issue. but API will have a trouble when group would set "kr.ksmartech.ev.web.api".  Let's see below e.g

 

We want to implement like below, but group is different structure, so that make a collision. 

MonaEvCloudServer("kr.ksmartech.ev")          MonaEvApi ("kr.ksmartech.ev.web.api")

           |___________ MonaEvEntity__________|

 

MonaEvApi will require to point Component Scan. it was still be issue, althogh ComponentScan was set.

This issue is based on diffrent structure. Let's fix correct structure like this

 

MonaEvApi - Fixed version

 

group = 'kr.ksmartech.ev'
version = "1.0-API-SNAPSHOT"

dependencies {
    ...
    
    implementation project(":MonaEvEntity")
  
    ...

}​

MonaEvCloudServer("kr.ksmartech.ev")          MonaEvApi ("kr.ksmartech.ev")

           |___________ MonaEvEntity__________|

 

 

 

https://oingdaddy.tistory.com/254

 

Springboot 에서 @ComponentScan 설정 및 사용법

이전 Xml Config 방식에서 ComponentScan을 사용하는 방법은 다음과 같았다. applicationContext를 구성할때 이렇게 명시적으로 내가 읽어들여야하는 component들이 있는 package를 넣어줬다. 하지만 Springboot에서

oingdaddy.tistory.com

 

 

'Java' 카테고리의 다른 글

Java - Json 과 Gson 이란?  (0) 2024.09.23
[Spring Security] HTTP Basic Auth  (0) 2024.09.23
Improved Java Logging with Mapped Diagnostic Context (MDC)  (1) 2024.09.12
[Spring] ST_intersects method  (1) 2024.09.09
[Pageable] withSort  (0) 2024.08.30

+ Recent posts