Red Hat Training

A Red Hat training course is available for Red Hat Fuse

Chapter 11. Deploying Projects to a Container

Abstract

To deploy a project into a container, you must either have already started the container using its command shell, or you must start it up from inside the JBoss Fuse Tooling (for details, see Chapter 19, Managing servers.
The Deploy to... tool ( ) makes deploying applications into containers a one step process.
The tooling supports direct deployment into the following containers:
  • Red Hat JBoss Fuse
  • Apache ServiceMix
  • Apache Karaf
You can deploy Fuse projects into a container three ways:
  • via a container's deploy folder
    You copy the package generated by the tooling into the container's deploy folder. This method has two drawbacks, as the tooling does not:
    • verify that the project builds a package that is compatible with the target container
    • provide feedback as to whether the deployment succeeds or fails
  • via a JMX connected container
    The tooling builds the project, and, regardless of the packaging specified in the project's POM, installs the generated artifacts as a bundle. You can use Fabric Explorer to determine whether the project deploys successfully.
  • via a fabric profile
    The tooling builds the project, packages the generated artifacts into a bundle, adds the bundle to the profile, and copies the bundle into the fabric's internal repository.
    Important
    If the profile is not assigned to a running container the project will not be deployed into the fabric. You must assign the profile to a running container before you can see the project running.
Note
You can deploy a project by dropping it onto a connected container in Fabric Explorer, or onto a fabric profile in Fabric Explorer.

11.1. Using a Container's Deploy Folder

When the tooling deploys a project into a container's deploy folder, it builds the project as specified in the project's POM and copies the resulting package to a predetermined location. The tooling assumes two things:
  • the specified location is a container's deploy folder
  • the package generated by the project is compatible with the container
Before you can deploy a project to a container's deploy folder you must add the container's deployment information to the tooling. Once the tooling knows the container's information, the container will appear as an option in the Deploy To... menu.

11.1.1. Configuring a Container's Deploy Folder

Overview

Before you can deploy applications into a container's deploy folder, you must provide the tooling with the location of the container's deploy folder. The Deploy Folders preference panel enables you to configure one or more containers. You provide a name for the container and the full path to the container's deployment folder.

Accessing the Deploy Folder preference panel

You can access the deployment folders preference panel two ways:
  • selecting JBoss Developer StudioPreferences from the main menu
    This method opens the general Eclipse preference window. You need to select Fuse ToolingDeploy Folders from the list of preferences in the panel on the left side of the widow.
  • selecting Deploy to...Deploy Folder Configurations... from the project's context menu
    This method opens the preferences window and ensures that the Deploy Folders panel is selected.

Add a container's deploy folder

To add a container's deploy folder:
  1. Open the Deploy Folder preference panel.
  2. In the Name field, enter a name for the target container.
    The name can be any unique string.
  3. In the Deploy Folder field, enter the full path to the container's deployment folder.
    The button opens a file explorer.
    Important
    The tooling does not validate whether the selected folder is a valid deployment folder for a container.
  4. In the Description field, enter a description for the container.
  5. Click Add to add the new container to the table of configured containers.
  6. Click OK to close the preferences window.
When you add a container to the list, it appears in the context menus' Deploy to... submenu.

Edit a container's deploy folder

To edit a container's deploy folder:
  1. Open the Deploy Folder preference panel.
  2. Select the container whose configuration you want to edit.
  3. Edit the information that needs updating.
    Important
    Changing the value of the Name field creates a new container configuration.
  4. Click .
  5. Click OK to close the preferences window.

Delete a container's deploy folder

To delete a container's deploy folder:
  1. Open the Deploy Folder preference panel.
  2. Select the container to be deleted.
  3. Click .
  4. Click OK to close the preferences window.

Related topics

Chapter 11, Deploying Projects to a Container
Deploy Folders

11.1.2. Deploying a Project to a Container's Deploy Folder

Overview

When the tooling deploys a project to a container's deploy folder, it builds the project and copies the results to the deploy folder configured for the container.

Procedure

To deploy a project to a container's deploy folder:
  1. Select the routing context file that you want to deploy.
    Important
    The project must be configured to package the results in a format that the target container can deploy.
  2. Select Deploy to...containerName from the project's context menu.
    The tooling builds the project and copies the results to the selected container's deploy folder.
    Note
    If you have not already configured a container, you can do so by selecting Deploy to...Deploy Folder Configurations... from the context menu.
  3. Check the Console view to see if your project was successfully built and copied to the target container.
  4. Check the container's log files to see if the project was successfully deployed.

Related topics

Section 11.1.1, “Configuring a Container's Deploy Folder”