91

I have done considerable research in internet and I haven't found any easy explanation what to do with BOM files with Maven.

The problem is that I use JBoss 7.1.1 and I want to include all JBoss client jars in pom.xml. JBoss has a manual that says that I should use BOM files, but I don't know how to use it in my pom.xml.

Please help.

Jens Piegsa
  • 7,399
  • 5
  • 58
  • 106
user2071995
  • 931
  • 1
  • 6
  • 5

1 Answers1

154

A bom is a so called bill of materials - it bundles several dependencies to assure that the versions will work together. JBoss has boms for many of it's projects, including Arquillian and the JBoss AS itself.

There is an explanation of the bom usage in the maven docs - it is hidden well below.

A practical example:

You include the bom into your pom like this:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.jboss.bom</groupId>
            <artifactId>jboss-javaee-6.0-with-tools</artifactId>
            <version>${javaee6.with.tools.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement> 

Then you do not have to specify the version attribute of a dependency, if it is defined in the bom like this:

<dependency>
    <groupId>javax.enterprise</groupId>
    <artifactId>cdi-api</artifactId>
    <scope>provided</scope>
</dependency>
tmarwen
  • 15,750
  • 5
  • 43
  • 62
kostja
  • 60,521
  • 48
  • 179
  • 224
  • In fact once you install Jboss you can find jboss-eap-6.0\bin\client\jboss-client.jar In the same folder there is readme.txt C:\jboss-eap-6.0\bin\client\README.txt – Reddymails Dec 23 '13 at 22:04
  • 2
    @Reddymails - yeah, this is probably the very manual the OP was not sure how to interpret. Good find. – kostja Dec 24 '13 at 06:08
  • 2
    By the way, another useful pointer : [Maven and JBoss: how to use BOMs to keep releases in sync](http://www.mastertheboss.com/jboss-maven/maven-and-jboss-how-to-use-boms) – Guillaume Husta May 13 '14 at 15:31