Chapter 20. Configuring a Fabric's Maven Proxy


The Fabric Ensemble creates a Maven proxy to access the repositories from which artifacts are distributed to the fabric's containers. You can modify the default settings to use a different set of repositories or make an internal repository accessible.


The Fabric Ensemble creates a Maven proxy to facilitate access to the artifacts required by the containers in the fabric. Each Fabric Server deployed in the fabric runs an instance of a Maven proxy. The ensemble aggregates all of the proxies so that it appears to the Fabric Agents as a single Maven proxy.
The Fabric Agents use the fabric's Maven proxy to access the known repositories. This ensures that all of the containers use the same set of repositories and artifacts.
Advanced users can configure each Fabric server to act as a proxy for a different set of repositories. However, this is not a recommended set up.
Fuse Management Console provides tooling for uploading bundles using the Maven proxy. You can also add the fabric's Maven Proxy to a POM file so that bundles can be distributed to the ensemble as part of an automated build process.

Default repositories

By default a fabric's Maven proxy is configured to be a proxy for the following Maven repositories:
  • Maven Central (
  • Fuse Public (
  • Fuse Releases (
  • Fuse Early Access (
  • JBoss Public (
  • SpringSource (,
  • User's Local (~/.m2/repository)

Changing the repositories

To change the repositories the ensemble proxies:
  1. Create a new profile version. From the command console this is done using the fabric:version-create command. See section "fabric:version-create" in "Console Reference" for more information.
  2. Change the org.ops4j.pax.url.mvn.repositories property in the io.fabric8.agent PID of the default profile. Example 20.1, “Configuring the Maven Proxy URL” shows the console command for editing this property.

    Example 20.1. Configuring the Maven Proxy URL

    JBossFuse:karaf@root> fabric:profile-edit -p io.fabric8.agent/org.ops4j.pax.url.mvn.repositories = file:${runtime.home}/${karaf.default.repository}@snapshots@id=karaf-default, file:${}/maven/upload@snapshots@id=fabric-upload,,,,,,,
    The io.fabric8.agent PID is refined in all of the fabric profiles. Setting the proxy URL, the org.ops4j.pax.url.mvn.repositories property, in the default profile ensures that all of the other fabric profiles share the same Maven proxy setting.
    The fabric profile's io.fabric8.maven PID, which ultimately controls the Maven proxy, imports its value from the default profile's io.fabric8.agent PID. You should not change the settings of the io.fabric8.maven PID.
    Alternatively, instead of resetting the entire list of repositories, you can append a new entry to the repository list by invoking fabric:profile-edit with the --append option, as follows:
    JBossFuse:karaf@root> profile-edit --pid io.fabric8.agent/org.ops4j.pax.url.mvn.repositories='' --append default 1.1
  3. Roll the changes out the fabric by upgrading the containers to the new profile version.
    You cannot test this configuration change out on a few containers to validate it. The change must be made to the entire fabric or it will result in conflicts.

Using an HTTP proxy with the Maven proxy

Using fabric's built-in Maven proxy, all nodes communicate directly with each other over HTTP. If you need to secure this communication (as when fabric's maven proxy must request maven artifacts from remote repositories), you can configure an HTTP proxy in fabric using a Maven settings.xml file that includes an HTTP proxy configuration.
To do so, follow these steps:
  1. Prepare an HTTP proxy settings file (see Example 20.2, “Example HTTP proxy settings .xml file” for example content), and put it in the Red Hat JBoss Fuse InstallDir/fuse/ directory.
  2. Start up JBoss Fuse, and create a fabric. For details, see ???.
  3. Specify the name and location of the HTTP settings file. At the JBossFuse:karaf@root> command line, type:
    profile-edit --pid io.fabric8.maven/io.fabric8.maven.settings=/home/fuse/http-proxy-settings.xml default
  4. Remove the org.ops4j.pax,url.mvn.repositories property from the default profile. At the JBossFuse:karaf@root> command line, type:
    profile-edit --delete --pid io.fabric8.agent/org.ops4j.pax.url.mvn.repositories default
    Removing this property causes the Maven proxy to pick up repositories from Maven's /home/.m2/settings.xml file, pointed to in the /home/fuse/http-proxy-settings.xml file.
    All fabric Maven proxy requests for remote repositories will now be redirected to the HTTP proxy server.

Example 20.2. Example HTTP proxy settings .xml file

<settings xmlns="" 
  <!-- localRepository contains the path to the local repository maven  
       will use to store artifacts. Default: ~/.m2/repository -->