Chapter 13. Configuring a Fabric's Maven Proxy
Abstract
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 the make an internal repository accessible.
Overview
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.
Note
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.
Note
Red Hat JBoss Fuse Tooling 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 (http://repo1.maven.org/maven2)
- Fuse Releases (http://repo.fusesource.com/nexus/content/repositories/releases)
- Fuse Early Access (http://repo.fusesource.com/nexus/content/groups/ea)
- SpringSource (http://repository.springsource.com/maven/bundles/release, http://repository.springsource.com/maven/bundles/external)
- Scala Tools (
http://scala-tools.org/repo-releases
) - User's Local (~/.m2/repository)
Changing the repositories
To change the repositories the ensemble proxies:
- Create a new profile version.From the command console this is done using the fabric:version-create command. See section "Description" in "Console Reference"section "Description" in "Console Reference" for more information.
- Change the
org.ops4j.pax.url.mvn.repositories
property in theio.fabric8.agent
PID of thedefault
profile. Example 13.1, “Configuring the Maven Proxy URL” shows the console command for editing this property.Example 13.1. Configuring the Maven Proxy URL
JBossFuse:karaf@root> fabric:profile-edit -p io.fabric8.agent/org.ops4j.pax.url.mvn.repositories= \ http://repo1.maven.org/maven2, \ http://repo.fusesource.com/nexus/content/repositories/releases, \ http://repo.fusesource.com/nexus/content/groups/ea, \ http://repository.springsource.com/maven/bundles/release, \ http://repository.springsource.com/maven/bundles/external, \ http://scala-tools.org/repo-releases default
NoteTheio.fabric8.agent
PID is refined in all of the fabric profiles. Setting the proxy URL, theorg.ops4j.pax.url.mvn.repositories
property, in thedefault
profile ensures that all of the other fabric profiles share the same Maven proxy setting.ImportantThefabric
profile'sio.fabric8.maven
PID, which ultimately controls the Maven proxy, imports its value from thedefault
profile'sio.fabric8.agent
PID. You should not change the settings of theio.fabric8.maven
PID. - Roll the changes out the fabric by upgrading the containers to the new profile version.ImportantYou 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.