6.5. BOM 파일 통합
BOM 파일을 Maven 프로젝트에 통합하려면 프로젝트의 pom.xml 파일(또는 상위 POM 파일)에 dependencyManagement 요소를 지정합니다.
Spring Boot 2 BOM
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project ...>
...
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- configure the versions you want to use here -->
<fuse.version>7.9.0.fuse-sb2-790065-redhat-00001</fuse.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.redhat-fuse</groupId>
<artifactId>fuse-springboot-bom</artifactId>
<version>${fuse.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
...
</project>
종속성 관리 메커니즘을 사용하여 BOM을 지정한 후 아티팩트 버전을 지정하지 않고 Maven 종속성을 POM에 추가할 수 있습니다. 예를 들어 camel-hystrix 구성 요소에 대한 종속성을 추가하려면 POM의 종속성 요소에 다음 XML 조각을 추가합니다.
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-hystrix-starter</artifactId> </dependency>
Camel 아티팩트 ID를 -starter suffix Cryostat- Cryostat로 지정하는 방법에 유의하십시오. 즉 Camel Hystrix 구성 요소를 로 지정합니다. Camel 시작 구성 요소는 Spring Boot 환경에 최적화된 방식으로 패키지됩니다.
camel-hystrix -starter