LibraryToggle FramesPrintFeedback

Locating Artifacts in a Fabric

Overview

Fabric containers also use Maven to locate artifacts, however they do so in a more constrained manner than a standalone container. Fabric containers use Maven through the fabric's Maven proxy and never search the local repository of the system on which it is running.

The Maven proxy attempts to strike a similar balance between accessing artifacts locally and accessing artifacts from remote repositories, however it changes the scope of local and remote. For default features, the artifacts are always stored in the fabric's system repository which is maintained by the fabric's ensemble servers. For non-default features, third party bundles, or customer developed bundles, it is likely that Maven will need to search remote repositories that are outside of the fabric to locate the artifacts.

Procedure for locating artifacts

Figure 7 shows an overview of the procedure that a fabric container follows when a feature or bundle is installed.

Figure 7. How Containers Locate Artifacts in a Fabric

How Containers Locate Artifacts in a Fabric

The steps followed to locate the required Maven artifacts are:

  1. The container contacts the fabric Maven proxy to search for the artifacts.

  2. The proxy searches for the artifacts in the fabric's system repository.

    This repository contains all of the artifacts provided with the Fuse ESB Enterprise installation.

  3. If the artifacts are not available in system repository, the proxy searches the remote repositories specified in its configuration.

    See Configuring a Fabric's Maven Proxy in Configuring and Running Fuse ESB Enterprise for details on how to configure a fabric's Maven proxy.

  4. The Maven proxy downloads the artifacts to the container.

Loading artifacts into the fabric's repository

Because fabric containers generally do not check a repository local to the machine on which it is running, you must load all of an application's artifacts into a repository that the fabric's Maven proxy knows about. There are two ways to do this:

  • load the application's artifacts into the fabric's system repository

    Maven can upload artifacts directly to the fabric's system repository by adding a repository element defining the Maven proxy's repository to the POM's distributionManagement element. Example 7 shows a POM entry for connecting to a fabric's repository when one of the Fabric Servers is running on the local machine.

    Example 7. Adding a Fabric Maven Proxy to a POM

    <distributionManagement>
      <repository>
        <id>fabric-maven-proxy</id>
        <name>FMC Maven Proxy</name>
        <url>http://username:password@localhost:8107/maven/upload/</url>
      </repository>
    </distributionManagement>

    You will need to modify the url element to include the connection details for your environment:

    • The username and password are the credentials used access the Fabric Server to which you are trying to connect.

    • The hostname, localhost in Example 7, is the address of the machine hosting the Fabric Server.

    • The port number, 8107 in Example 7, is the port number exposed by the Fabric Server. 8107 is the default setting.

    • The path, /maven/upload/ in Example 7, is the same for all Fabric Servers.

    [Tip]Tip

    Fuse IDE can also be used to upload artifacts to a fabric's system repository. Fuse IDE will also generate a profile for deploying the application to a container.

  • load the application's artifacts to a custom repository and configure the fabric's Maven proxy to include the custom repository

    This is a good option if an application is going to be used in multiple fabrics because you will not need to install the application into a separate repository for each fabric used. All of the fabrics will use a single, centrally located version of the application.

    To configure the fabric's Maven proxy see Configuring a Fabric's Maven Proxy in Configuring and Running Fuse ESB Enterprise.

Comments powered by Disqus