Using WildFly BOMs

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active
 

Maven Bill of Materials are used to keep the versions in the project using the artifacts in synch with the versions distributed in the library. The WildFly BOMs project therefore allows you to easily use your stack of choice.  

You can find the list of available WildFly BOMs here http://central.maven.org/maven2/org/wildfly/bom/

This list can be split in two groups:

  • BOMS which are related to WildFly 8 and 9
  • BOMS which are related to WildFly 10
# WildFly 8/9 BOMS
jboss-javaee-7.0-wildfly/                           
jboss-javaee-7.0-wildfly-with-hibernate3/          
jboss-javaee-7.0-wildfly-with-tools/                
jboss-javaee-7.0-with-all/                          
jboss-javaee-7.0-with-hibernate/                   
jboss-javaee-7.0-with-hibernate3/                  
jboss-javaee-7.0-with-infinispan/                   
jboss-javaee-7.0-with-logging/                      
jboss-javaee-7.0-with-resteasy/                     
jboss-javaee-7.0-with-security/                     
jboss-javaee-7.0-with-tools/                        
jboss-javaee-7.0-with-transactions/

# WildFly 10 BOMS                 
wildfly-javaee7/                                   
wildfly-javaee7-with-tools/                         

WildFly 10 BOMS

As you can see from the above list, WildFly 10 holds just two type of BOMS: wildfly-javaee7-with-tools which includes the whole Java EE 7 stack plus the Arquillian/JUnit testing platform:

wildfly bom tutorial

and wildfly-javaee7 which just contains the Java EE 7 Dependencies:

bom wildfly10

Using the BOMS is pretty easy: include in the dependencies section the BOM which you want to use:

 <dependencyManagement>
        <dependencies>
           
            <dependency>
                <groupId>org.wildfly.bom</groupId>
                <artifactId>wildfly-javaee7-with-tools</artifactId>
                <version>10.0.0.Final</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
</dependencyManagement>

Then within your library dependencies, you won't need to declare which version you are going to use, as this information is picked up from the BOM:

<dependency>
   <groupId>org.jboss.spec.javax.ejb</groupId>
   <artifactId>jboss-ejb-api_3.2_spec</artifactId>
   <scope>provided</scope>
</dependency>

WildFly 8/9 BOMS

The list of BOMS in WildFly 8 and 9 is more fine-grained as it contains a set of BOMS for each specific core library. Now let's see in the detail the BOMs available. The first one is jboss-javaee-7.0-with-all which includes everything that you might need for developing, testing, logging your applications:

wildfly maven bill of materials bom tutorial

Next one is jboss-javaee-7.0-with-hibernate which enhances the default Java EE 7 stack with Hibernate ORM plus other libraries such as Hibernate Search, Hibernate Validator, Envers, the JPA Model generator.

wildfly maven bill of materials bom tutorial

The BOM jboss-javaee-7.0-with-hibernate3 adds to the default Java EE 7 stack Hibernate 3 ORM, Hibernate Entity Manager (JPA 1.0) and Hibernate Validator.

wildfly maven bill of materials bom tutorial

The BOM jboss-javaee-7.0-with-infinispan adds to the default Java EE 7 stack Infinispan native API and HotRod Client

wildfly maven bill of materials bom tutorial

The BOM jboss-javaee-7.0-with-logging adds to the default Java EE 7 stack JBoss Logging Framework and Log4J API

wildfly maven bill of materials bom tutorial

The BOM jboss-javaee-7.0-with-resteasy includes to the Java EE 7 stack some RestEasy extra goodies such as extra Providers and Async Servlet 3.0 communication

wildfly maven bill of materials bom tutorial

The BOM jboss-javaee-7.0-with-security includes to the Java EE 7 stack JBoss Negotiation Dependencies and PicketLink API

wildfly maven bill of materials bom tutorial

The BOM jboss-javaee-7.0-with-tools includes to the Java EE 7 stack Arquillian and JUnit testing features along with some extra dependencies such as Shrinkwrap or Arquillian drone

wildfly maven bill of materials bom tutorial

Finally jboss-javaee-7.0-with-transactions adds to the Java EE 7 some dependencies found in the JBoss Naranya framework including for example XTS, WS-AT and WS-BA.

wildfly maven bill of materials bom tutorial

Using the BOMS is pretty easy: include in the dependencies section the BOM which you want to use:

<dependencyManagement> 
   <dependencies>
      <dependency>
         <groupId>org.wildfly.bom</groupId>
         <artifactId>jboss-javaee-7.0-with-all</artifactId>
         <version>8.0.0.Final</version>
         <scope>import</scope>
      </dependency>
   </dependencies>
</dependencyManagement>

Then within your library dependencies, you won't need to declare which version you are going to use, as this information is picked up from the BOM:

<dependency>
   <groupId>org.jboss.spec.javax.ejb</groupId>
   <artifactId>jboss-ejb-api_3.2_spec</artifactId>
   <scope>provided</scope>
</dependency>

References:

The above article is an excerpt from the upcoming book, Java EE 7 development on WildFly application server published by ItBuzzPress.

Advertisement