Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.20.5. Configuring Maven Proxies and HTTP Proxies through settings.xml
Overview Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
You can optionally configure the Maven proxy using a standard Maven
settings.xml file. For example, this approach is particularly convenient in a development environment, because it makes it possible to store your build time settings and your run time settings in one place.
The Maven
settings.xml approach is not used by default. You must explicitly enable it.
Adding a remote Maven repository Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
A default
settings.xml file is provided for you in InstallDir/etc/maven-settings.xml. To add a new remote Maven repository to the InstallDir/etc/maven-settings.xml file, open the maven-settings.xml file in a text editor and add a new repository XML element. For example, to create an entry for the Red Hat GA public Maven repository, add a repository element as shown:
Important
Do not forget to activate your profile, by adding an
activeProfile element that references the profile ID (in this example, the profile ID is default).
Enabling the settings.xml configuration approach Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
To configure Fabric to read its Maven configuration from a Maven
settings.xml file, perform the following steps:
- Configure the Maven repositories you need in the
InstallDir/etc/maven-settings.xmlfile (see the section called “Adding a remote Maven repository”). - Copy the Maven repositories from the
io.fabric8.agent/org.ops4j.pax.url.mvn.settingsproperty into themaven-settings.xmlfile (normally, you need to preserve access to these repositories). To see the list of repositories from theio.fabric8.agent/org.ops4j.pax.url.mvn.settingsproperty in thedefaultprofile, enter the following Fabric8 command:JBossFuse:karaf@root> profile-display default
JBossFuse:karaf@root> profile-display defaultCopy to Clipboard Copied! Toggle word wrap Toggle overflow Follow the instructions in the section called “Adding a remote Maven repository” to add these repositories set inio.fabric8.agent/org.ops4j.pax.url.mvn.settingsto themaven-settings.xmlfile (if they are not already present). - (Optional) If you want to combine the list of repositories appearing in the
maven-settings.xmlfile with the list of repositories from theio.fabric8.maven/io.fabric8.maven.repositoriesproperty, prepend a+sign to the list of repositories inio.fabric8.maven.repositories. For example:io.fabric8.maven.repositories=+http://repo1.maven.org/maven2@id=maven.central.repo,https://maven.repository.redhat.com/ga@id=redhat.ga.repo,https://maven.repository.redhat.com/earlyaccess/all@id=redhat.ea.repo,https://repository.jboss.org/nexus/content/groupsea@id=fuseearlyaccess
io.fabric8.maven.repositories=+http://repo1.maven.org/maven2@id=maven.central.repo,https://maven.repository.redhat.com/ga@id=redhat.ga.repo,https://maven.repository.redhat.com/earlyaccess/all@id=redhat.ea.repo,https://repository.jboss.org/nexus/content/groupsea@id=fuseearlyaccessCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Delete the
org.ops4j.pax.url.mvn.repositoriesproperty setting from theio.fabric8.agentPID in thedefaultprofile, using the following console command:profile-edit --delete --pid io.fabric8.agent/org.ops4j.pax.url.mvn.repositories default
profile-edit --delete --pid io.fabric8.agent/org.ops4j.pax.url.mvn.repositories defaultCopy to Clipboard Copied! Toggle word wrap Toggle overflow When the repositories setting is absent, Fabric implicitly switches to themaven-settings.xmlconfiguration approach.NoteBy default, this step simultaneously clears both the repository list used by the Fabric8 agent and the repository list used by the Maven proxy server (because the Maven proxy's repository list normally references the Fabric8 agent's repository list).
Changing the default location of Maven settings.xml Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
Fabric is pre-configured to use the
InstallDir/etc/maven-settings.xml file. That is, the following settings are configured by default:
io.fabric8.maven/io.fabric8.maven.settings = ${karaf.etc}/maven-settings.xml
io.fabric8.agent/org.ops4j.pax.url.mvn.settings = ${karaf.etc}/maven-settings.xml
io.fabric8.maven/io.fabric8.maven.settings = ${karaf.etc}/maven-settings.xml
io.fabric8.agent/org.ops4j.pax.url.mvn.settings = ${karaf.etc}/maven-settings.xml
If you need to customize the location of your Maven
settings.xml file, edit the value of these properties in the default profile.
Configuring an HTTP proxy Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
To configure an HTTP proxy (which will be used when connecting to remote Maven repositories), open the
etc/maven-settings.xml file in a text editor and add a new proxy XML element as a child of the proxies XML element. The definition of the proxy follows the standard Maven syntax. For example, to create a proxy for the HTTP (insecure) protocol with host, 127.0.0.1, and port, 3128, add a proxy element as follows:
You must remember to add the ensemble hosts (where the Maven proxy servers are running) to the list of HTTP non-proxy hosts in the
nonProxyHosts element. This ensures that the Fabric8 agents do not attempt to connect to the Maven proxies through the HTTP proxy, but make a direct connection instead. In the preceding example, the ensemble host names are ensemble1, ensemble2, and ensemble3.
By default, HTTPS connections use the same proxy settings as the HTTP protocol. If you need separate configuration for HTTPS, you can optionally add another
proxy element configured with the https protocol.
Reference Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
For a detailed description of the syntax of the Maven
settings.xml file, see the Maven Settings Reference. But please note that not all of the features documented there are necessarily supported by Fabric.