4

Can you help me understand what really the advantage of using a BOM pom is ?

more precisely what is the difference between using a BOM pom and writing the content of BOM pom in the dependencyManagement section of a parent pom ?

  <dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>xxx.yyy</groupId>
            <artifactId>com.so</artifactId>
            <version>${my.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

vs

 <dependencyManagement>
            <dependencies>
               ...
            </dependencies>
        </dependencyManagement>
GionJh
  • 2,742
  • 2
  • 29
  • 68
  • maybe a duplicate of https://stackoverflow.com/questions/38496022/maven-bom-bill-of-materials-dependency – Simion Aug 13 '18 at 18:53
  • 3
    If are library offers a BOM (for example spring-boot, spring, vaadin etc.) you can simply import it and you don't need to think about the versions your are really using..If you write it yourself into the dependencyManagement you need to think about the different versions and their relationship and version compatibility etc. – khmarbaise Aug 13 '18 at 19:01
  • 1
    It's like interfaces and abstract classes: You can only have a single parent POM, and it's useful to be able to include separate BOM mixins. – chrylis -cautiouslyoptimistic- Aug 13 '18 at 19:08

0 Answers0