Deploying the EJB application

As it is, you should be able to package your EJB project by issuing the following Maven goal and starting a command-line prompt from your project root:

mvn package

The preceding command will compile and package the application that needs to be copied into the deployments folder of your application server. This is fine; however, we can expect lots more from Maven by installing just a couple of plugins. In our case, we will configure our project to use Maven's WildFly plugin by adding the following section:

<build>
    <finalName>${project.artifactId}</finalName>
    <plugins>
        <!-- WildFly plugin to deploy the application -->
        <plugin>
            <groupId>org.wildfly.plugins</groupId>
            <artifactId>wildfly-maven-plugin</artifactId>

Get Java EE 7 Development with WildFly now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.