이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 12. 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 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
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 (http://repo1.maven.org/maven2)
  • Fuse Public (https://repo.fusesource.com/nexus/content/groups/public)
  • Fuse Releases (https://repo.fusesource.com/nexus/content/repositories/releases)
  • Fuse Early Access (https://repo.fusesource.com/nexus/content/groups/ea)
  • JBoss Public (https://repository.jboss.org/nexus/content/repositories/public)
  • SpringSource (http://repository.springsource.com/maven/bundles/release, http://repository.springsource.com/maven/bundles/external)
  • 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 12.1, “Configuring the Maven Proxy URL” shows the console command for editing this property.

    Example 12.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:${runtime.data}/maven/upload@snapshots@id=fabric-upload, http://repo1.maven.org/maven2@id=central, https://repo.fusesource.com/nexus/content/groups/public@id=fusepublic, https://repository.jboss.org/nexus/content/repositories/public@id=jbosspublic, https://repo.fusesource.com/nexus/content/repositories/releases@id=jbossreleases, https://repo.fusesource.com/nexus/content/groups/ea@id=jbossearlyaccess, http://repository.springsource.com/maven/bundles/release@id=ebrreleases, http://repository.springsource.com/maven/bundles/external@id=ebrexternal
    Copy to Clipboard Toggle word wrap
    Note
    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.
    Important
    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='http://fusewin.tpb.lab.eng.brq.redhat.com:8081/nexus/content/repositories/fuse-qe-repo@id=fuse-qa' --append default 1.1
    Copy to Clipboard Toggle word wrap
  3. Roll the changes out the fabric by upgrading the containers to the new profile version.
    Important
    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 12.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 the section called “Steps to create the fabric”.
  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
    Copy to Clipboard Toggle word wrap
  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
    Copy to Clipboard Toggle word wrap
    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 12.2. Example HTTP proxy settings .xml file

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
    http://maven.apache.org/xsd/settings-1.0.0.xsd">
    
  <!-- localRepository contains the path to the local repository maven  
       will use to store artifacts. Default: ~/.m2/repository -->
        
  <localRepository>/home/fuse/.m2/repository</localRepository>

      <proxies>
          <proxy>
              <id>qeos-proxy-1</id>
                  <active>true</active>
                  <protocol>http</protocol>
                  <host>10.8.50.13</host>
                  <port>3128</port>
          </proxy>
      </proxies>
      <profiles>
          <profile>
              <id>fuse-repo</id>
                  <repositories>
                      <repository>
                          <id>fuse-qe-repo</id>
                          <url>http://fusewin.tpb.lab.eng.brq.redhat.com:8081/nexus/content/repositories/fuse-qe-repo</url>
                              <layout>default</layout>
                      </repository>
                      <repository>
                          <id>central</id>
                          <url>http://repo1.maven.org/maven2@id=maven.central.repo</url>
                              <layout>default</layout>
                      </repository>
                  </repositories>
          </profile>
      </profiles>
      <activeProfiles>
          <activeProfile>fuse-repos</activeProfile>
      </activeProfiles>

</settings>
Copy to Clipboard Toggle word wrap
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat