Creating Maven Projects for WildFly

Login | Register

Creating Maven Projects for WildFly

Maven WildFly

The JBoss/WildFly way to configure Maven projects makes developing Java EE 7 applications with WildFly very straightforward.

Configuring a project to use the JBoss Java EE 7 Bill Of Materials (BOM) removes the difficulty of specifying what version of dependencies are required as these are already defined within the BOM.

So, to configure a WildFly project, we need to first define the BOM in the project’s pom.xml file.

<properties>
    <version.jboss.bom>8.0.0.Final</version.jboss.bom>
</properties>
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.wildfly.bom</groupId>
            <artifactId>jboss-javaee-7.0-with-tools</artifactId>
            <version>${version.jboss.bom}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

Once we’ve defined the BOM, we can easily add Maven dependencies without worrying about versions.

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

Simple !

About

At Develop In Java, we've been a part of the Java community for over 10 years. If there's anything you'd like us to cover, just ask !

Current versions

  • Java - 1.8
  • Java EE - 7
  • Spring - 4.x