Deploying an Application with JBoss EAP and Apache Maven

30 minutes
  • 4 Learning Objectives

About this Hands-on Lab

JBoss Enterprise Application Platform provides an extensive Java EE-based application server to which we can deploy and manage our applications. Oftentimes, this can be as simple as deploying a provided WAR or EAR file to our configured server, but when we’re creating development environments or otherwise want access to our pre-compiled application files, we can pair JBoss with Apache Maven, which will build our application before JBoss deploys it.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Install Apache Maven

Install Maven using sudo yum install maven.

Deploy the Application
  1. Move into the kitchensink directory:

    cd kitchensink
  1. Review the contents. It contains a pom.xml file for building and deploying the project in Maven. The project itself is stored in the src directory, along with tests.

    ls
  2. Deploy the application:

    sudo mvn clean install wildfly:deploy
  3. Visit PUBLICIP:8080/kitchensink to ensure the application is working.

Make a Change to the Application
  1. Undeploy the application:

    mvn wildfly:undeploy
  1. Make a superficial change to the application:

    vim src/main/webapp/WEB-INF/templates/default.xhtml
  2. Update the title to add a change:

    <title>Add a change!</title>
Redeploy the Application
  1. Deploy the application once more; notice how much faster it deploys this time:

    sudo mvn clean install wildfly:deploy
  1. Visit the application and take note of your change.

Additional Resources

You have been tasked with setting up the deployment scanner for your standalone JBoss hosts to streamline the deploy process. That said, you want to retain the ability to disable applications and want to employ some safeguards, so instead of utilizing auto-deployment, a simple deployment marker needs to be created for each deploy.

Using the CLI, disable auto-deployment for XML and zipped files, then test your changes by deploying the kitchensink.war application found in the cloud_user's home directory. You can check that the application is working by navigating to PUBLICIP:8080/kitchensink. Once finished, disable the application.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Get Started
Who’s going to be learning?

How many seats do you need?

  • $499 USD per seat per year
  • Billed Annually
  • Renews in 12 months

Ready to accelerate learning?

For over 25 licenses, a member of our sales team will walk you through a custom tailored solution for your business.


$2,495.00

Checkout
Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!