Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

최근 모던 빌드툴에 비해 메이븐은 설정이 복잡하고 어렵습니다. 그래서 스프링을 웹 프레임웍으로 선택하였다고하면프레임워크로 선택을 하였으면,

스프링을 사용하는 요소만큼은 단순하게 의존성을 셋팅할 필요가 단순해질필요가 있습니다.

원문문서 : https://spring.io/guides/gs/multi-module/


의존성 단순화:

Spring Boot INITIALIZER 을 이용한 Spring 의존요소 단순화

...

Spring 은 여러가지 오픈소스의 집합체입니다. Rest를 사용하기위해 A -REST를, JSON을 사용하기위해 B를B-JSON,

데이터베이스를 사용하기위해 C를 C-JPA등을 사용할수가 있습니다.

하지만 각 오픈소스는 별개로 업그레이드가되며

A-1  , B-3 , C-5  와같이 버젼의 분기가일어나며 각각 다른 버젼조합을 사용하게되며

그 조합에다른 문제파악은 순전히 그것을 사용하는 개발자가 파악해야하는 부분입니다.

stater의 그룹 집합은 spring boot에서 그 조합을 충분히 검증을 하고 그룹화한 사항이며 모듈이며

하위 버젼을 뭘로 쓸지 알필요가 신경쓸필요가 없습니다.

단지 메이져 버젼만을 선택하고 , 웹요소에 사용되는 수많은 의존성을 우리는 'spring-boot-starter-web' 만 사용하면 됩니다.

...

이것은 마이크로 서비스를 가기위해 아주 중요합니다.  단지  단지 하나의 어플리케이션에서만 수백라인의 의존 복잡성을 관리해야하고

그것이 어플리케이션마다 다르다고 해봅시다.  클러스터 서비스로 구성하기전에 우리는 대부분의 시간을 메이븐 설정에 메달려야할것입니다고통을 받을것입니다.


Spring Boot 의 웹요소를 사용하기위한 메이븐 셋팅예...

Code Block
languagejava
themeEmacs
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.1.RELEASE</version>
</parent>
<dependencies>
   <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
   </dependency>
</dependencies>

그 외 gradle,sbt 등 최근 빌드툴을 사용하는것도 설정을 단순화 할수 있는 방법입니다.

위 xml은 두줄의 코드로만 관리될수도 있습니다.

...

  • 모든 프로젝트가 공통으로 참조하는것 ( 오픈소스 공통 라이브러리)
  • 특정 프로젝트만 참조하는것 ( 특정 로컬 참조)
  • 그룹 프로젝트가 공통으로 참조하는것 ( 내부공통 라이브러리)
Bad

Image Added

의존성 관계가 스파게티가 되는 일반적인 예입니다.


Good Case

Image Added



여기서 의존성 단순화 목표는 , 우리가 사용할 스프링요소에대해서 크게 신경쓰지 않는 것입니다.

스프링 4,5 의 의존성을 모두 이해하고 있다는 있다고하면 작은 요소하나하나를 요소 하나하나를 각각 설정해도 됩니다.

하지만 이것은 우리가 설계할 서비스보다 더 복잡해질수 있으며, 이렇게 시작되고 오랫동안 유지되는

...

더이상 신규 라이브러리를 도입하기 어려운 상황이 오게됩니다.{"kind":"views","type":null,"data":[{"_type":"UMLPackageView","_id":"AAAAAAFnaUxrQA81GEQ=","_parent":{"$ref":"AAAAAAFnaUwhbw8aoAg="},"model":{"$ref":"AAAAAAFnaUxrPw8zTss="},"subViews":[{"_type":"UMLNameCompartmentView","_id":"AAAAAAFnaUxrQA82Kec=","_parent":{"$ref":"AAAAAAFnaUxrQA81GEQ="},"model":{"$ref":"AAAAAAFnaUxrPw8zTss="},"subViews":[{"_type":"LabelView","_id":"AAAAAAFnaUxrQA83DjE=","_parent":{"$ref":"AAAAAAFnaUxrQA82Kec="},"visible":false,"font":"Arial;13;0","left":-48,"top":32,"height":13},{"_type":"LabelView","_id":"AAAAAAFnaUxrQA84Asw=","_parent":{"$ref":"AAAAAAFnaUxrQA82Kec="},"font":"Arial;13;1","left":85,"top":206,"width":59.99169921875,"height":13,"text":"Root"},{"_type":"LabelView","_id":"AAAAAAFnaUxrQA85sdc=","_parent":{"$ref":"AAAAAAFnaUxrQA82Kec="},"visible":false,"font":"Arial;13;0","left":-48,"top":32,"width":80.9072265625,"height":13,"text":"(from Model2)"},{"_type":"LabelView","_id":"AAAAAAFnaUxrQA867Is=","_parent":{"$ref":"AAAAAAFnaUxrQA82Kec="},"visible":false,"font":"Arial;13;0","left":-48,"top":32,"height":13,"horizontalAlignment":1}],"font":"Arial;13;0","left":80,"top":199,"width":69.99169921875,"height":25,"stereotypeLabel":{"$ref":"AAAAAAFnaUxrQA83DjE="},"nameLabel":{"$ref":"AAAAAAFnaUxrQA84Asw="},"namespaceLabel":{"$ref":"AAAAAAFnaUxrQA85sdc="},"propertyLabel":{"$ref":"AAAAAAFnaUxrQA867Is="}}],"font":"Arial;13;0","containerChangeable":true,"left":80,"top":184,"width":69.99169921875,"height":48,"nameCompartment":{"$ref":"AAAAAAFnaUxrQA82Kec="}},{"_type":"UMLPackageView","_id":"AAAAAAFnaU1LNg9QWU4=","_parent":{"$ref":"AAAAAAFnaUwhbw8aoAg="},"model":{"$ref":"AAAAAAFnaU1LNQ9OSjk="},"subViews":[{"_type":"UMLNameCompartmentView","_id":"AAAAAAFnaU1LNg9RBso=","_parent":{"$ref":"AAAAAAFnaU1LNg9QWU4="},"model":{"$ref":"AAAAAAFnaU1LNQ9OSjk="},"subViews":[{"_type":"LabelView","_id":"AAAAAAFnaU1LNg9S0IU=","_parent":{"$ref":"AAAAAAFnaU1LNg9RBso="},"visible":false,"font":"Arial;13;0","left":176,"top":144,"height":13},{"_type":"LabelView","_id":"AAAAAAFnaU1LNg9T0bA=","_parent":{"$ref":"AAAAAAFnaU1LNg9RBso="},"font":"Arial;13;1","left":261,"top":214,"width":88.1435546875,"height":13,"text":"config-service"},{"_type":"LabelView","_id":"AAAAAAFnaU1LNg9ULcQ=","_parent":{"$ref":"AAAAAAFnaU1LNg9RBso="},"visible":false,"font":"Arial;13;0","left":176,"top":144,"width":80.9072265625,"height":13,"text":"(from Model2)"},{"_type":"LabelView","_id":"AAAAAAFnaU1LNg9Vvs4=","_parent":{"$ref":"AAAAAAFnaU1LNg9RBso="},"visible":false,"font":"Arial;13;0","left":176,"top":144,"height":13,"horizontalAlignment":1}],"font":"Arial;13;0","left":256,"top":207,"width":98.1435546875,"height":25,"stereotypeLabel":{"$ref":"AAAAAAFnaU1LNg9S0IU="},"nameLabel":{"$ref":"AAAAAAFnaU1LNg9T0bA="},"namespaceLabel":{"$ref":"AAAAAAFnaU1LNg9ULcQ="},"propertyLabel":{"$ref":"AAAAAAFnaU1LNg9Vvs4="}}],"font":"Arial;13;0","containerChangeable":true,"left":256,"top":192,"width":98.1435546875,"height":40,"nameCompartment":{"$ref":"AAAAAAFnaU1LNg9RBso="}},{"_type":"UMLPackageView","_id":"AAAAAAFnaU2k+Q9rrzc=","_parent":{"$ref":"AAAAAAFnaUwhbw8aoAg="},"model":{"$ref":"AAAAAAFnaU2k+Q9p0fo="},"subViews":[{"_type":"UMLNameCompartmentView","_id":"AAAAAAFnaU2k+Q9sCZY=","_parent":{"$ref":"AAAAAAFnaU2k+Q9rrzc="},"model":{"$ref":"AAAAAAFnaU2k+Q9p0fo="},"subViews":[{"_type":"LabelView","_id":"AAAAAAFnaU2k+Q9tky4=","_parent":{"$ref":"AAAAAAFnaU2k+Q9sCZY="},"visible":false,"font":"Arial;13;0","left":208,"top":256,"height":13},{"_type":"LabelView","_id":"AAAAAAFnaU2k+Q9uOAo=","_parent":{"$ref":"AAAAAAFnaU2k+Q9sCZY="},"font":"Arial;13;1","left":261,"top":326,"width":59.99169921875,"height":13,"text":"front-web"},{"_type":"LabelView","_id":"AAAAAAFnaU2k+g9v+o0=","_parent":{"$ref":"AAAAAAFnaU2k+Q9sCZY="},"visible":false,"font":"Arial;13;0","left":208,"top":256,"width":80.9072265625,"height":13,"text":"(from Model2)"},{"_type":"LabelView","_id":"AAAAAAFnaU2k+g9wNs0=","_parent":{"$ref":"AAAAAAFnaU2k+Q9sCZY="},"visible":false,"font":"Arial;13;0","left":208,"top":256,"height":13,"horizontalAlignment":1}],"font":"Arial;13;0","left":256,"top":319,"width":69.99169921875,"height":25,"stereotypeLabel":{"$ref":"AAAAAAFnaU2k+Q9tky4="},"nameLabel":{"$ref":"AAAAAAFnaU2k+Q9uOAo="},"namespaceLabel":{"$ref":"AAAAAAFnaU2k+g9v+o0="},"propertyLabel":{"$ref":"AAAAAAFnaU2k+g9wNs0="}}],"font":"Arial;13;0","containerChangeable":true,"left":256,"top":304,"width":69.99169921875,"height":40,"nameCompartment":{"$ref":"AAAAAAFnaU2k+Q9sCZY="}},{"_type":"UMLPackageView","_id":"AAAAAAFnaU3EPA+FfUQ=","_parent":{"$ref":"AAAAAAFnaUwhbw8aoAg="},"model":{"$ref":"AAAAAAFnaU3EOw+Dwag="},"subViews":[{"_type":"UMLNameCompartmentView","_id":"AAAAAAFnaU3EPA+GhXo=","_parent":{"$ref":"AAAAAAFnaU3EPA+FfUQ="},"model":{"$ref":"AAAAAAFnaU3EOw+Dwag="},"subViews":[{"_type":"LabelView","_id":"AAAAAAFnaU3EPA+HtXU=","_parent":{"$ref":"AAAAAAFnaU3EPA+GhXo="},"visible":false,"font":"Arial;13;0","left":208,"top":224,"height":13},{"_type":"LabelView","_id":"AAAAAAFnaU3EPA+IKWw=","_parent":{"$ref":"AAAAAAFnaU3EPA+GhXo="},"font":"Arial;13;1","left":261,"top":382,"width":59.99169921875,"height":13,"text":"some-api"},{"_type":"LabelView","_id":"AAAAAAFnaU3EPA+JnQA=","_parent":{"$ref":"AAAAAAFnaU3EPA+GhXo="},"visible":false,"font":"Arial;13;0","left":208,"top":224,"width":80.9072265625,"height":13,"text":"(from Model2)"},{"_type":"LabelView","_id":"AAAAAAFnaU3EPA+KZuw=","_parent":{"$ref":"AAAAAAFnaU3EPA+GhXo="},"visible":false,"font":"Arial;13;0","left":208,"top":224,"height":13,"horizontalAlignment":1}],"font":"Arial;13;0","left":256,"top":375,"width":69.99169921875,"height":25,"stereotypeLabel":{"$ref":"AAAAAAFnaU3EPA+HtXU="},"nameLabel":{"$ref":"AAAAAAFnaU3EPA+IKWw="},"namespaceLabel":{"$ref":"AAAAAAFnaU3EPA+JnQA="},"propertyLabel":{"$ref":"AAAAAAFnaU3EPA+KZuw="}}],"font":"Arial;13;0","containerChangeable":true,"left":256,"top":360,"width":69.99169921875,"height":40,"nameCompartment":{"$ref":"AAAAAAFnaU3EPA+GhXo="}},{"_type":"UMLPackageView","_id":"AAAAAAFnaU4cXg+g/X0=","_parent":{"$ref":"AAAAAAFnaUwhbw8aoAg="},"model":{"$ref":"AAAAAAFnaU4cXQ+eJrQ="},"subViews":[{"_type":"UMLNameCompartmentView","_id":"AAAAAAFnaU4cXg+hwtw=","_parent":{"$ref":"AAAAAAFnaU4cXg+g/X0="},"model":{"$ref":"AAAAAAFnaU4cXQ+eJrQ="},"subViews":[{"_type":"LabelView","_id":"AAAAAAFnaU4cXg+ilog=","_parent":{"$ref":"AAAAAAFnaU4cXg+hwtw="},"visible":false,"font":"Arial;13;0","left":192,"top":-208,"height":13},{"_type":"LabelView","_id":"AAAAAAFnaU4cXg+jL2s=","_parent":{"$ref":"AAAAAAFnaU4cXg+hwtw="},"font":"Arial;13;1","left":261,"top":270,"width":138.759765625,"height":13,"text":"eureka-serviceregistry"},{"_type":"LabelView","_id":"AAAAAAFnaU4cXg+k8/0=","_parent":{"$ref":"AAAAAAFnaU4cXg+hwtw="},"visible":false,"font":"Arial;13;0","left":192,"top":-208,"width":80.9072265625,"height":13,"text":"(from Model2)"},{"_type":"LabelView","_id":"AAAAAAFnaU4cXg+lEeE=","_parent":{"$ref":"AAAAAAFnaU4cXg+hwtw="},"visible":false,"font":"Arial;13;0","left":192,"top":-208,"height":13,"horizontalAlignment":1}],"font":"Arial;13;0","left":256,"top":263,"width":148.759765625,"height":25,"stereotypeLabel":{"$ref":"AAAAAAFnaU4cXg+ilog="},"nameLabel":{"$ref":"AAAAAAFnaU4cXg+jL2s="},"namespaceLabel":{"$ref":"AAAAAAFnaU4cXg+k8/0="},"propertyLabel":{"$ref":"AAAAAAFnaU4cXg+lEeE="}}],"font":"Arial;13;0","containerChangeable":true,"left":256,"top":248,"width":148.759765625,"height":40,"nameCompartment":{"$ref":"AAAAAAFnaU4cXg+hwtw="}},{"_type":"UMLDependencyView","_id":"AAAAAAFnaU725g/E50o=","_parent":{"$ref":"AAAAAAFnaUwhbw8aoAg="},"model":{"$ref":"AAAAAAFnaU725Q/CSDk="},"subViews":[{"_type":"EdgeLabelView","_id":"AAAAAAFnaU725g/F6x0=","_parent":{"$ref":"AAAAAAFnaU725g/E50o="},"model":{"$ref":"AAAAAAFnaU725Q/CSDk="},"visible":false,"font":"Arial;13;0","left":201,"top":217,"height":13,"alpha":1.5707963267948966,"distance":15,"hostEdge":{"$ref":"AAAAAAFnaU725g/E50o="},"edgePosition":1},{"_type":"EdgeLabelView","_id":"AAAAAAFnaU725g/GAFY=","_parent":{"$ref":"AAAAAAFnaU725g/E50o="},"model":{"$ref":"AAAAAAFnaU725Q/CSDk="},"visible":null,"font":"Arial;13;0","left":201,"top":232,"height":13,"alpha":1.5707963267948966,"distance":30,"hostEdge":{"$ref":"AAAAAAFnaU725g/E50o="},"edgePosition":1},{"_type":"EdgeLabelView","_id":"AAAAAAFnaU725g/HP30=","_parent":{"$ref":"AAAAAAFnaU725g/E50o="},"model":{"$ref":"AAAAAAFnaU725Q/CSDk="},"visible":false,"font":"Arial;13;0","left":202,"top":188,"height":13,"alpha":-1.5707963267948966,"distance":15,"hostEdge":{"$ref":"AAAAAAFnaU725g/E50o="},"edgePosition":1}],"font":"Arial;13;0","head":{"$ref":"AAAAAAFnaUxrQA81GEQ="},"tail":{"$ref":"AAAAAAFnaU1LNg9QWU4="},"lineStyle":1,"points":"255:210;150:208","showVisibility":true,"nameLabel":{"$ref":"AAAAAAFnaU725g/F6x0="},"stereotypeLabel":{"$ref":"AAAAAAFnaU725g/GAFY="},"propertyLabel":{"$ref":"AAAAAAFnaU725g/HP30="}},{"_type":"UMLDependencyView","_id":"AAAAAAFnaU8Yww/VTlk=","_parent":{"$ref":"AAAAAAFnaUwhbw8aoAg="},"model":{"$ref":"AAAAAAFnaU8Yww/TeDg="},"subViews":[{"_type":"EdgeLabelView","_id":"AAAAAAFnaU8Yww/WCPc=","_parent":{"$ref":"AAAAAAFnaU8Yww/VTlk="},"model":{"$ref":"AAAAAAFnaU8Yww/TeDg="},"visible":false,"font":"Arial;13;0","left":183,"top":270,"height":13,"alpha":1.5707963267948966,"distance":15,"hostEdge":{"$ref":"AAAAAAFnaU8Yww/VTlk="},"edgePosition":1},{"_type":"EdgeLabelView","_id":"AAAAAAFnaU8Yww/XkWw=","_parent":{"$ref":"AAAAAAFnaU8Yww/VTlk="},"model":{"$ref":"AAAAAAFnaU8Yww/TeDg="},"visible":null,"font":"Arial;13;0","left":174,"top":282,"height":13,"alpha":1.5707963267948966,"distance":30,"hostEdge":{"$ref":"AAAAAAFnaU8Yww/VTlk="},"edgePosition":1},{"_type":"EdgeLabelView","_id":"AAAAAAFnaU8Yww/YLl4=","_parent":{"$ref":"AAAAAAFnaU8Yww/VTlk="},"model":{"$ref":"AAAAAAFnaU8Yww/TeDg="},"visible":false,"font":"Arial;13;0","left":200,"top":245,"height":13,"alpha":-1.5707963267948966,"distance":15,"hostEdge":{"$ref":"AAAAAAFnaU8Yww/VTlk="},"edgePosition":1}],"font":"Arial;13;0","head":{"$ref":"AAAAAAFnaUxrQA81GEQ="},"tail":{"$ref":"AAAAAAFnaU4cXg+g/X0="},"lineStyle":1,"points":"255:265;192:264;148:232","showVisibility":true,"nameLabel":{"$ref":"AAAAAAFnaU8Yww/WCPc="},"stereotypeLabel":{"$ref":"AAAAAAFnaU8Yww/XkWw="},"propertyLabel":{"$ref":"AAAAAAFnaU8Yww/YLl4="}},{"_type":"UMLDependencyView","_id":"AAAAAAFnaU8+Og/m7zA=","_parent":{"$ref":"AAAAAAFnaUwhbw8aoAg="},"model":{"$ref":"AAAAAAFnaU8+OQ/kQ9U="},"subViews":[{"_type":"EdgeLabelView","_id":"AAAAAAFnaU8+Og/n/HE=","_parent":{"$ref":"AAAAAAFnaU8+Og/m7zA="},"model":{"$ref":"AAAAAAFnaU8+OQ/kQ9U="},"visible":false,"font":"Arial;13;0","left":179,"top":322,"height":13,"alpha":1.5707963267948966,"distance":15,"hostEdge":{"$ref":"AAAAAAFnaU8+Og/m7zA="},"edgePosition":1},{"_type":"EdgeLabelView","_id":"AAAAAAFnaU8+Og/oqLc=","_parent":{"$ref":"AAAAAAFnaU8+Og/m7zA="},"model":{"$ref":"AAAAAAFnaU8+OQ/kQ9U="},"visible":null,"font":"Arial;13;0","left":167,"top":331,"height":13,"alpha":1.5707963267948966,"distance":30,"hostEdge":{"$ref":"AAAAAAFnaU8+Og/m7zA="},"edgePosition":1},{"_type":"EdgeLabelView","_id":"AAAAAAFnaU8+Og/pgN0=","_parent":{"$ref":"AAAAAAFnaU8+Og/m7zA="},"model":{"$ref":"AAAAAAFnaU8+OQ/kQ9U="},"visible":false,"font":"Arial;13;0","left":204,"top":305,"height":13,"alpha":-1.5707963267948966,"distance":15,"hostEdge":{"$ref":"AAAAAAFnaU8+Og/m7zA="},"edgePosition":1}],"font":"Arial;13;0","head":{"$ref":"AAAAAAFnaUxrQA81GEQ="},"tail":{"$ref":"AAAAAAFnaU2k+Q9rrzc="},"lineStyle":1,"points":"255:322;192:320;131:232","showVisibility":true,"nameLabel":{"$ref":"AAAAAAFnaU8+Og/n/HE="},"stereotypeLabel":{"$ref":"AAAAAAFnaU8+Og/oqLc="},"propertyLabel":{"$ref":"AAAAAAFnaU8+Og/pgN0="}},{"_type":"UMLDependencyView","_id":"AAAAAAFnaU9SYA/3phI=","_parent":{"$ref":"AAAAAAFnaUwhbw8aoAg="},"model":{"$ref":"AAAAAAFnaU9SYA/1wOM="},"subViews":[{"_type":"EdgeLabelView","_id":"AAAAAAFnaU9SYA/4Wss=","_parent":{"$ref":"AAAAAAFnaU9SYA/3phI="},"model":{"$ref":"AAAAAAFnaU9SYA/1wOM="},"visible":false,"font":"Arial;13;0","left":161,"top":375,"height":13,"alpha":1.5707963267948966,"distance":15,"hostEdge":{"$ref":"AAAAAAFnaU9SYA/3phI="},"edgePosition":1},{"_type":"EdgeLabelView","_id":"AAAAAAFnaU9SYA/5BTA=","_parent":{"$ref":"AAAAAAFnaU9SYA/3phI="},"model":{"$ref":"AAAAAAFnaU9SYA/1wOM="},"visible":null,"font":"Arial;13;0","left":147,"top":380,"height":13,"alpha":1.5707963267948966,"distance":30,"hostEdge":{"$ref":"AAAAAAFnaU9SYA/3phI="},"edgePosition":1},{"_type":"EdgeLabelView","_id":"AAAAAAFnaU9SYA/6ARQ=","_parent":{"$ref":"AAAAAAFnaU9SYA/3phI="},"model":{"$ref":"AAAAAAFnaU9SYA/1wOM="},"visible":false,"font":"Arial;13;0","left":190,"top":364,"height":13,"alpha":-1.5707963267948966,"distance":15,"hostEdge":{"$ref":"AAAAAAFnaU9SYA/3phI="},"edgePosition":1}],"font":"Arial;13;0","head":{"$ref":"AAAAAAFnaUxrQA81GEQ="},"tail":{"$ref":"AAAAAAFnaU3EPA+FfUQ="},"lineStyle":1,"points":"255:378;176:376;123:232","showVisibility":true,"nameLabel":{"$ref":"AAAAAAFnaU9SYA/4Wss="},"stereotypeLabel":{"$ref":"AAAAAAFnaU9SYA/5BTA="},"propertyLabel":{"$ref":"AAAAAAFnaU9SYA/6ARQ="}},{"_type":"UMLModelView","_id":"AAAAAAFnaU/dChALEzQ=","_parent":{"$ref":"AAAAAAFnaUwhbw8aoAg="},"model":{"$ref":"AAAAAAFnaU/dCBAJq6A="},"subViews":[{"_type":"UMLNameCompartmentView","_id":"AAAAAAFnaU/dChAMWtw=","_parent":{"$ref":"AAAAAAFnaU/dChALEzQ="},"model":{"$ref":"AAAAAAFnaU/dCBAJq6A="},"subViews":[{"_type":"LabelView","_id":"AAAAAAFnaU/dChANIps=","_parent":{"$ref":"AAAAAAFnaU/dChAMWtw="},"visible":false,"font":"Arial;13;0","left":48,"top":112,"height":13},{"_type":"LabelView","_id":"AAAAAAFnaU/dChAOX68=","_parent":{"$ref":"AAAAAAFnaU/dChAMWtw="},"font":"Arial;13;1","left":261,"top":462,"width":44.78271484375,"height":13,"text":"library"},{"_type":"LabelView","_id":"AAAAAAFnaU/dChAP/7Y=","_parent":{"$ref":"AAAAAAFnaU/dChAMWtw="},"visible":false,"font":"Arial;13;0","left":48,"top":112,"width":80.9072265625,"height":13,"text":"(from Model2)"},{"_type":"LabelView","_id":"AAAAAAFnaU/dChAQgO8=","_parent":{"$ref":"AAAAAAFnaU/dChAMWtw="},"visible":false,"font":"Arial;13;0","left":48,"top":112,"height":13,"horizontalAlignment":1}],"font":"Arial;13;0","left":256,"top":455,"width":54.78271484375,"height":25,"stereotypeLabel":{"$ref":"AAAAAAFnaU/dChANIps="},"nameLabel":{"$ref":"AAAAAAFnaU/dChAOX68="},"namespaceLabel":{"$ref":"AAAAAAFnaU/dChAP/7Y="},"propertyLabel":{"$ref":"AAAAAAFnaU/dChAQgO8="}}],"font":"Arial;13;0","containerChangeable":true,"left":256,"top":440,"width":54.78271484375,"height":40,"nameCompartment":{"$ref":"AAAAAAFnaU/dChAMWtw="}},{"_type":"UMLPackageView","_id":"AAAAAAFnaVDeTxAtNSo=","_parent":{"$ref":"AAAAAAFnaUwhbw8aoAg="},"model":{"$ref":"AAAAAAFnaVDeTxArKuw="},"subViews":[{"_type":"UMLNameCompartmentView","_id":"AAAAAAFnaVDeTxAuUP0=","_parent":{"$ref":"AAAAAAFnaVDeTxAtNSo="},"model":{"$ref":"AAAAAAFnaVDeTxArKuw="},"subViews":[{"_type":"LabelView","_id":"AAAAAAFnaVDeTxAviTA=","_parent":{"$ref":"AAAAAAFnaVDeTxAuUP0="},"visible":false,"font":"Arial;13;0","top":112,"height":13},{"_type":"LabelView","_id":"AAAAAAFnaVDeTxAwwUA=","_parent":{"$ref":"AAAAAAFnaVDeTxAuUP0="},"font":"Arial;13;1","left":85,"top":134,"width":102.54638671875,"height":13,"text":"Spring Boot Stat"},{"_type":"LabelView","_id":"AAAAAAFnaVDeTxAxMmg=","_parent":{"$ref":"AAAAAAFnaVDeTxAuUP0="},"visible":false,"font":"Arial;13;0","top":112,"width":80.9072265625,"height":13,"text":"(from Model2)"},{"_type":"LabelView","_id":"AAAAAAFnaVDeTxAyzwA=","_parent":{"$ref":"AAAAAAFnaVDeTxAuUP0="},"visible":false,"font":"Arial;13;0","top":112,"height":13,"horizontalAlignment":1}],"font":"Arial;13;0","left":80,"top":127,"width":112.54638671875,"height":25,"stereotypeLabel":{"$ref":"AAAAAAFnaVDeTxAviTA="},"nameLabel":{"$ref":"AAAAAAFnaVDeTxAwwUA="},"namespaceLabel":{"$ref":"AAAAAAFnaVDeTxAxMmg="},"propertyLabel":{"$ref":"AAAAAAFnaVDeTxAyzwA="}}],"font":"Arial;13;0","containerChangeable":true,"left":80,"top":112,"width":112.54638671875,"height":40,"nameCompartment":{"$ref":"AAAAAAFnaVDeTxAuUP0="}},{"_type":"UMLDependencyView","_id":"AAAAAAFnaVGRvBBJ6ZU=","_parent":{"$ref":"AAAAAAFnaUwhbw8aoAg="},"model":{"$ref":"AAAAAAFnaVGRuxBH9R8="},"subViews":[{"_type":"EdgeLabelView","_id":"AAAAAAFnaVGRvBBKBgU=","_parent":{"$ref":"AAAAAAFnaVGRvBBJ6ZU="},"model":{"$ref":"AAAAAAFnaVGRuxBH9R8="},"visible":false,"font":"Arial;13;0","left":300,"top":414,"height":13,"alpha":1.5707963267948966,"distance":15,"hostEdge":{"$ref":"AAAAAAFnaVGRvBBJ6ZU="},"edgePosition":1},{"_type":"EdgeLabelView","_id":"AAAAAAFnaVGRvBBL5r4=","_parent":{"$ref":"AAAAAAFnaVGRvBBJ6ZU="},"model":{"$ref":"AAAAAAFnaVGRuxBH9R8="},"visible":null,"font":"Arial;13;0","left":315,"top":415,"height":13,"alpha":1.5707963267948966,"distance":30,"hostEdge":{"$ref":"AAAAAAFnaVGRvBBJ6ZU="},"edgePosition":1},{"_type":"EdgeLabelView","_id":"AAAAAAFnaVGRvBBMOIE=","_parent":{"$ref":"AAAAAAFnaVGRvBBJ6ZU="},"model":{"$ref":"AAAAAAFnaVGRuxBH9R8="},"visible":false,"font":"Arial;13;0","left":271,"top":411,"height":13,"alpha":-1.5707963267948966,"distance":15,"hostEdge":{"$ref":"AAAAAAFnaVGRvBBJ6ZU="},"edgePosition":1}],"font":"Arial;13;0","head":{"$ref":"AAAAAAFnaU/dChALEzQ="},"tail":{"$ref":"AAAAAAFnaU3EPA+FfUQ="},"lineStyle":1,"points":"288:400;284:439","showVisibility":true,"nameLabel":{"$ref":"AAAAAAFnaVGRvBBKBgU="},"stereotypeLabel":{"$ref":"AAAAAAFnaVGRvBBL5r4="},"propertyLabel":{"$ref":"AAAAAAFnaVGRvBBMOIE="}},{"_type":"UMLDependencyView","_id":"AAAAAAFnaVGz9RBbrDc=","_parent":{"$ref":"AAAAAAFnaUwhbw8aoAg="},"model":{"$ref":"AAAAAAFnaVGz9RBZXkE="},"subViews":[{"_type":"EdgeLabelView","_id":"AAAAAAFnaVGz9RBcHo4=","_parent":{"$ref":"AAAAAAFnaVGz9RBbrDc="},"model":{"$ref":"AAAAAAFnaVGz9RBZXkE="},"visible":false,"font":"Arial;13;0","left":161,"top":453,"height":13,"alpha":1.5707963267948966,"distance":15,"hostEdge":{"$ref":"AAAAAAFnaVGz9RBbrDc="},"edgePosition":1},{"_type":"EdgeLabelView","_id":"AAAAAAFnaVGz9RBdQdM=","_parent":{"$ref":"AAAAAAFnaVGz9RBbrDc="},"model":{"$ref":"AAAAAAFnaVGz9RBZXkE="},"visible":null,"font":"Arial;13;0","left":146,"top":457,"height":13,"alpha":1.5707963267948966,"distance":30,"hostEdge":{"$ref":"AAAAAAFnaVGz9RBbrDc="},"edgePosition":1},{"_type":"EdgeLabelView","_id":"AAAAAAFnaVGz9RBepkE=","_parent":{"$ref":"AAAAAAFnaVGz9RBbrDc="},"model":{"$ref":"AAAAAAFnaVGz9RBZXkE="},"visible":false,"font":"Arial;13;0","left":190,"top":446,"height":13,"alpha":-1.5707963267948966,"distance":15,"hostEdge":{"$ref":"AAAAAAFnaVGz9RBbrDc="},"edgePosition":1}],"font":"Arial;13;0","head":{"$ref":"AAAAAAFnaUxrQA81GEQ="},"tail":{"$ref":"AAAAAAFnaU/dChALEzQ="},"lineStyle":1,"points":"255:458;176:456;120:232","showVisibility":true,"nameLabel":{"$ref":"AAAAAAFnaVGz9RBcHo4="},"stereotypeLabel":{"$ref":"AAAAAAFnaVGz9RBdQdM="},"propertyLabel":{"$ref":"AAAAAAFnaVGz9RBepkE="}},{"_type":"UMLSubsystemView","_id":"AAAAAAFnaVHy6hBtXC4=","_parent":{"$ref":"AAAAAAFnaUwhbw8aoAg="},"model":{"$ref":"AAAAAAFnaVHy6RBrGiQ="},"subViews":[{"_type":"UMLNameCompartmentView","_id":"AAAAAAFnaVHy6xBuVa8=","_parent":{"$ref":"AAAAAAFnaVHy6hBtXC4="},"model":{"$ref":"AAAAAAFnaVHy6RBrGiQ="},"subViews":[{"_type":"LabelView","_id":"AAAAAAFnaVHy6xBvm6o=","_parent":{"$ref":"AAAAAAFnaVHy6xBuVa8="},"visible":false,"font":"Arial;13;0","left":-304,"top":48,"height":13},{"_type":"LabelView","_id":"AAAAAAFnaVHy6xBwMsg=","_parent":{"$ref":"AAAAAAFnaVHy6xBuVa8="},"font":"Arial;13;1","left":85,"top":78,"width":114.81005859375,"height":13,"text":"Spring Boot Cloud"},{"_type":"LabelView","_id":"AAAAAAFnaVHy6xBxVBE=","_parent":{"$ref":"AAAAAAFnaVHy6xBuVa8="},"visible":false,"font":"Arial;13;0","left":-304,"top":48,"width":80.9072265625,"height":13,"text":"(from Model2)"},{"_type":"LabelView","_id":"AAAAAAFnaVHy6xBy3/o=","_parent":{"$ref":"AAAAAAFnaVHy6xBuVa8="},"visible":false,"font":"Arial;13;0","left":-304,"top":48,"height":13,"horizontalAlignment":1}],"font":"Arial;13;0","left":80,"top":71,"width":124.81005859375,"height":25,"stereotypeLabel":{"$ref":"AAAAAAFnaVHy6xBvm6o="},"nameLabel":{"$ref":"AAAAAAFnaVHy6xBwMsg="},"namespaceLabel":{"$ref":"AAAAAAFnaVHy6xBxVBE="},"propertyLabel":{"$ref":"AAAAAAFnaVHy6xBy3/o="}}],"font":"Arial;13;0","containerChangeable":true,"left":80,"top":56,"width":124.81005859375,"height":40,"nameCompartment":{"$ref":"AAAAAAFnaVHy6xBuVa8="}},{"_type":"UMLDependencyView","_id":"AAAAAAFnaVKjqBCSz8Q=","_parent":{"$ref":"AAAAAAFnaUwhbw8aoAg="},"model":{"$ref":"AAAAAAFnaVKjpxCQUjo="},"subViews":[{"_type":"EdgeLabelView","_id":"AAAAAAFnaVKjqBCTw8Q=","_parent":{"$ref":"AAAAAAFnaVKjqBCSz8Q="},"model":{"$ref":"AAAAAAFnaVKjpxCQUjo="},"visible":false,"font":"Arial;13;0","left":110,"top":157,"height":13,"alpha":1.5707963267948966,"distance":15,"hostEdge":{"$ref":"AAAAAAFnaVKjqBCSz8Q="},"edgePosition":1},{"_type":"EdgeLabelView","_id":"AAAAAAFnaVKjqBCUpx4=","_parent":{"$ref":"AAAAAAFnaVKjqBCSz8Q="},"model":{"$ref":"AAAAAAFnaVKjpxCQUjo="},"visible":null,"font":"Arial;13;0","left":96,"top":153,"height":13,"alpha":1.5707963267948966,"distance":30,"hostEdge":{"$ref":"AAAAAAFnaVKjqBCSz8Q="},"edgePosition":1},{"_type":"EdgeLabelView","_id":"AAAAAAFnaVKjqBCVKKk=","_parent":{"$ref":"AAAAAAFnaVKjqBCSz8Q="},"model":{"$ref":"AAAAAAFnaVKjpxCQUjo="},"visible":false,"font":"Arial;13;0","left":139,"top":164,"height":13,"alpha":-1.5707963267948966,"distance":15,"hostEdge":{"$ref":"AAAAAAFnaVKjqBCSz8Q="},"edgePosition":1}],"font":"Arial;13;0","head":{"$ref":"AAAAAAFnaVDeTxAtNSo="},"tail":{"$ref":"AAAAAAFnaUxrQA81GEQ="},"lineStyle":1,"points":"121:183;129:152","showVisibility":true,"nameLabel":{"$ref":"AAAAAAFnaVKjqBCTw8Q="},"stereotypeLabel":{"$ref":"AAAAAAFnaVKjqBCUpx4="},"propertyLabel":{"$ref":"AAAAAAFnaVKjqBCVKKk="}},{"_type":"UMLDependencyView","_id":"AAAAAAFnaVK2TRCjJkE=","_parent":{"$ref":"AAAAAAFnaUwhbw8aoAg="},"model":{"$ref":"AAAAAAFnaVK2TRCh4bM="},"subViews":[{"_type":"EdgeLabelView","_id":"AAAAAAFnaVK2TRCkFn4=","_parent":{"$ref":"AAAAAAFnaVK2TRCjJkE="},"model":{"$ref":"AAAAAAFnaVK2TRCh4bM="},"visible":false,"font":"Arial;13;0","left":123,"top":94,"height":13,"alpha":1.5707963267948966,"distance":15,"hostEdge":{"$ref":"AAAAAAFnaVK2TRCjJkE="},"edgePosition":1},{"_type":"EdgeLabelView","_id":"AAAAAAFnaVK2TRClQIs=","_parent":{"$ref":"AAAAAAFnaVK2TRCjJkE="},"model":{"$ref":"AAAAAAFnaVK2TRCh4bM="},"visible":null,"font":"Arial;13;0","left":108,"top":92,"height":13,"alpha":1.5707963267948966,"distance":30,"hostEdge":{"$ref":"AAAAAAFnaVK2TRCjJkE="},"edgePosition":1},{"_type":"EdgeLabelView","_id":"AAAAAAFnaVK2TRCmbps=","_parent":{"$ref":"AAAAAAFnaVK2TRCjJkE="},"model":{"$ref":"AAAAAAFnaVK2TRCh4bM="},"visible":false,"font":"Arial;13;0","left":152,"top":99,"height":13,"alpha":-1.5707963267948966,"distance":15,"hostEdge":{"$ref":"AAAAAAFnaVK2TRCjJkE="},"edgePosition":1}],"font":"Arial;13;0","head":{"$ref":"AAAAAAFnaVHy6hBtXC4="},"tail":{"$ref":"AAAAAAFnaVDeTxAtNSo="},"lineStyle":1,"points":"137:111;139:96","showVisibility":true,"nameLabel":{"$ref":"AAAAAAFnaVK2TRCkFn4="},"stereotypeLabel":{"$ref":"AAAAAAFnaVK2TRClQIs="},"propertyLabel":{"$ref":"AAAAAAFnaVK2TRCmbps="}}],"context":{"id":"AAAAAAFnaUwhbw8aoAg=","type":"UMLPackageDiagram","refs":["AAAAAAFnaUxrPw8zTss=","AAAAAAFnaU1LNQ9OSjk=","AAAAAAFnaU2k+Q9p0fo=","AAAAAAFnaU3EOw+Dwag=","AAAAAAFnaU4cXQ+eJrQ=","AAAAAAFnaU725Q/CSDk=","AAAAAAFnaU8Yww/TeDg=","AAAAAAFnaU8+OQ/kQ9U=","AAAAAAFnaU9SYA/1wOM=","AAAAAAFnaU/dCBAJq6A=","AAAAAAFnaVDeTxArKuw=","AAAAAAFnaVGRuxBH9R8=","AAAAAAFnaVGz9RBZXkE=","AAAAAAFnaVHy6RBrGiQ=","AAAAAAFnaVKjpxCQUjo=","AAAAAAFnaVK2TRCh4bM="]}}


Root 셋팅예

Code Block
languagejava
themeEmacs
title/pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.webnori.psmon.cloudspring</groupId>
    <artifactId>psmon-cloudspring</artifactId>
    <version>0.1.0</version>
    <packaging>pom</packaging>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.1.RELEASE</version>
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <spring-cloud.version>Greenwich.M3</spring-cloud.version>
    </properties>


    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>


    <modules>
        <module>config-service</module>
        <module>eureka-serviceregistry</module>
        <module>library</module>
        <module>front-web</module>
        <module>accountapi</module>
        <module>lobbyapi</module>
        <module>gameapi</module>
    </modules>

    <repositories>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>
    

</project>

설정 포인트:

  • 사용되는 라이브러리의 버젼을 모두 중앙에서 관리합니다. properties 설정및 dependencyManagement에서 목표를 이룰수 있습니다.
  • spring-boot-starter 을 사용하여 부트 사용 요소를 단일화 합니다.
  • repositories 는 spring의 snapshorts버젼을 사용못하게 막습니다. (릴리즈 이상만 사용)
  • modules는 이 시스템이 가진 하위 시스템을 명시합니다. ( 기본으로 하위 디렉토리)
  • groupid지정은 전체 모듈이 같이 사용할수 있게 그룹핑하며 artifactid에서 실제 하위 서비스를 구분하게합니다.  


하위 프로젝트 예

Code Block
languagejava
themeEmacs
title/eureka-serviceregistry/pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>

   <artifactId>eureka-serviceregistry</artifactId>
   <version>0.0.1-SNAPSHOT</version>
   <packaging>jar</packaging>

   <name>eureka-serviceregistry</name>
   <description>Demo project for Spring Boot</description>

   <parent>
      <groupId>com.webnori.psmon.cloudspring</groupId>
      <artifactId>psmon-cloudspring</artifactId>
      <version>0.1.0</version>
      <relativePath>../</relativePath>
   </parent>

   <properties>
   </properties>

   <dependencies>
      <!-- Eureka Server -->
      <dependency>
         <groupId>org.springframework.cloud</groupId>
         <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
      </dependency>

      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-test</artifactId>
      </dependency>
   </dependencies>

   <build>
      <plugins>
         <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
         </plugin>
      </plugins>
   </build>

</project>


설정포인트:

  • 자신의 부모를 (parent)를 지정합니다. 그룹은 부모에서 정해졌기때문에 지정할 필요없습니다.
  • 부모에서 어떠한 버젼의 요소를 사용할것인가 이미 정리가 되었기때문에 , 추가 사용모듈에대해 버젼지정을 하지 않습니다.
  • 하위 모듈에서 만약 버젼을 한번 지정하기 시작하면, 다른 하위모듈에서도 지정하기때문에 서로 다른 버젼이되어 작동될수 있습니다.



Note

복잡하게 얽혀있는 오픈소스 디펜던시를 메이븐에 셋팅하려고하니 노하우와 경험이 필요해 보입니다.

시간이되면 Gradle과 양방향 호환되는 방향으로 셋팅하고 싶지만 ( 기존 대부분의 인프라가 메이븐으로 설정되어 있음 )

메이븐에서 계속 깔금한 구조를 개선및 시도중에 있습니다.