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.此内容没有您所选择的语言版本。
Appendix C. Generating a Custom Assembly or an Offline Repository
Overview 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
The Karaf container in JBoss Fuse comes with a large collection of features installed by default. While this offers the advantage of a highly functional container, it suffers from the drawback of requiring a large amount of memory and resources. For some deployment scenarios, it can be an advantage to strip down the Karaf container to use the minimal set of features required for your application. A custom assembly is the most effective way to create a stripped down Karaf container that deploys only the features needed for your application.
The same procedure that is used to generate a custom assembly also, incidentally, generates an offline repository.
Custom assembly 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
A custom assembly is a custom distribution of the Karaf container based on JBoss Fuse, which is generated using a specific toolchain of Maven plug-ins. The quickstart examples include a template,
quickstart/custom
, which demonstrates how this toolchain works and provides you with the starting point for creating your own custom assemblies.
Note
A custom assembly is generated using essentially the same toolchain as the official JBoss Fuse Karaf container distribution.
Patched custom assembly 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
If your starting point is a JBoss Fuse rollup patch (which is, in fact, equivalent to a complete distribution of the JBoss Fuse product with patches already applied), and you then follow the steps for generating a custom assembly, what you end up with is a patched custom assembly. No actual patching step needs to be performed in this case, however, because the patch is already built-in to the custom assembly.
Offline repository 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
An offline repository is a Maven repository that contains a custom collection of Maven artifacts that would otherwise need to be downloaded from the Internet. For JBoss Fuse deployments that lack Internet access, the offline repository makes it possible to run the container in an isolated network by providing all of the Maven artifacts that your application might need. For details about how to install an offline repository in a standalone Karaf container, see chapter "Locating Artifacts with Maven and HTTP" in "Deploying into Apache Karaf".
quickstart/custom example 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
The
quickstart/custom
example provides a template for generating your own custom assembly. The default configuration of the custom example includes a very minimal collection of Karaf features. You can easily customize this configuration to specify example which Karaf features you would like to include in the custom assembly.
To generate a custom assembly, or a patched custom assembly, or an offline Maven repository, perform the following steps:
- Choose the appropriate starting point for this procedure:
- To generate a custom assembly—download and install the standard Full Install from the Red Hat Customer Portal, as described in Chapter 3, Installing; or
- To generate a patched custom assembly—download the latest rollup patch from the Red Hat Customer Portal.
- Go to the
InstallDir/quickstarts/custom
project. - Customize the features that will be included in the custom assembly's
system/
directory (or in the generated offline repository) by editing the project'spom.xml
file. Thepatch
feature and thefabric
feature are both required, and must be added to the configuration.Open thequickstarts/custom/pom.xml
file in a text editor, search for thefeatures-maven-plugin
plug-in configuration, and add thepatch
feature and thefabric
feature as children of theconfiguration/features
XML element—for example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - (Not required for an offline repository) Customize the list of features that will be installed automatically when the custom assembly's container first starts. The
patch
feature and thefabric
feature are both required, and must be added to this list.Open thesrc/main/filtered-resources/etc/org.apache.karaf.features.cfg
file and modify thefeaturesBoot
property setting as required, adding at least thefabric
feature and thepatch
feature to the list:... # TODO: list the boot features for your own assembly below featuresBoot=shell,admin,management,fabric,patch,camel-blueprint,camel-jaxb
... # TODO: list the boot features for your own assembly below featuresBoot=shell,admin,management,fabric,patch,camel-blueprint,camel-jaxb
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - After customizing the configuration of the
quickstarts/custom
project, build the project as follows:mvn clean package
mvn clean package
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - The offline repository is now available in the following directory:
InstallDir/quickstarts/custom/target/repository
InstallDir/quickstarts/custom/target/repository
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If the purpose of this build is to create an offline repository, the procedure is now finished and you can skip the remaining steps. - The result of building this project is a custom assembly file, in the following location:
InstallDir/quickstarts/custom/target/custom-distro-ProductVersion-bin.zip
InstallDir/quickstarts/custom/target/custom-distro-ProductVersion-bin.zip
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - The custom assembly requires some additional modifications. In preparation for this, unpack the custom assembly file,
custom-distro-ProductVersion-bin.zip
, into a convenient working location on the file system:Working/custom-distro-ProductVersion-bin
Working/custom-distro-ProductVersion-bin
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - To reduce the size of the custom assembly, delete the
extras/
subdirectory fromcustom-distro-ProductVersion-bin
(saving about 67 MB). - Create a new baseline archive for the custom assembly, as follows:
- Make a copy of the entire
Working/custom-distro-ProductVersion-bin
directory, to give a copy like the following:Working/custom-distro-ProductVersion-bin(copy)
Working/custom-distro-ProductVersion-bin(copy)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Rename the copied directory,
custom-distro-ProductVersion-bin(copy)
, to the following:jboss-fuse-full-ProductVersion-baseline
jboss-fuse-full-ProductVersion-baseline
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example, if theProductVersion
is 6.2.1.redhat-084, the new directory name must bejboss-fuse-full-6.2.1.redhat-084-baseline
. - Delete the
system/
subdirectory from thejboss-fuse-full-ProductVersion-baseline
directory. - Using an archive tool, compress the
jboss-fuse-full-ProductVersion-baseline
directory in Zip format to give the following archive file:jboss-fuse-full-ProductVersion-baseline.zip
jboss-fuse-full-ProductVersion-baseline.zip
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The preceding file is the baseline archive for the custom assembly.
- Copy the baseline archive to the following subdirectory (must be created) of the original custom assembly,
Working/custom-distro-ProductVersion-bin
:system/org/jboss/fuse/jboss-fuse-full/ProductVersion
system/org/jboss/fuse/jboss-fuse-full/ProductVersion
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - The custom assembly,
Working/custom-distro-ProductVersion-bin
, is now complete. If you like, you can compress this directory into a Zip archive and distribute it as is. - Test the new custom assembly to make sure it is working properly. Launch the Karaf container, as follows:
cd Working/custom-distro-ProductVersion-bin/bin ./fuse
cd Working/custom-distro-ProductVersion-bin/bin ./fuse
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The container should start up without error. To make sure that no errors have occurred, check the log:JBossFuse:karaf@root> log:display
JBossFuse:karaf@root> log:display
Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can also check to see whether all of the expected Karaf features are installed:JBossFuse:karaf@root> features:list -i
JBossFuse:karaf@root> features:list -i
Copy to Clipboard Copied! Toggle word wrap Toggle overflow When you are finished testing the custom assembly container, shut it down by entering theshutdown
console command, and tidy up the custom assembly installation by removing thedata/
subdirectory (which holds the data from the current container instance).
Troubleshooting 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
There are a few common errors you might encounter when attempting to start the custom assembly container. Here is a brief explanation of what these errors mean:
- The following error indicates that the baseline archive was not correctly installed in the
system
directory:ERROR: Bundle org.apache.felix.framework [0] EventDispatcher: Error during dispatch. (io.fabric8.patch.management.PatchException: Can't find baseline distribution in patches dir or inside system repository.) io.fabric8.patch.management.PatchException: Can't find baseline distribution in patches dir or inside system repository. at io.fabric8.patch.management.impl.GitPatchManagementServiceImpl.trackBaselineRepository(GitPatchManagementServiceImpl.java:1820) at ...
ERROR: Bundle org.apache.felix.framework [0] EventDispatcher: Error during dispatch. (io.fabric8.patch.management.PatchException: Can't find baseline distribution in patches dir or inside system repository.) io.fabric8.patch.management.PatchException: Can't find baseline distribution in patches dir or inside system repository. at io.fabric8.patch.management.impl.GitPatchManagementServiceImpl.trackBaselineRepository(GitPatchManagementServiceImpl.java:1820) at ...
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - The following error indicates that the
patch
feature is not deployed in the container:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - The following error indicates that the
patch
feature was successfully deployed, but the requiredfabric
feature is missing:ERROR: Bundle io.fabric8.patch.patch-core [49] Error starting mvn:io.fabric8.patch/patch-core/1.2.0.redhat-621092 (org.osgi.framework.BundleException: Unresolved constraint in bundle io.fabric8.patch.patch-core [49]: Unable to resolve 49.0: missing requirement [49.0] osgi.wiring.package; (&(osgi.wiring.package=io.fabric8.api)(version>=1.2.0)(!(version>=2.0.0))))
ERROR: Bundle io.fabric8.patch.patch-core [49] Error starting mvn:io.fabric8.patch/patch-core/1.2.0.redhat-621092 (org.osgi.framework.BundleException: Unresolved constraint in bundle io.fabric8.patch.patch-core [49]: Unable to resolve 49.0: missing requirement [49.0] osgi.wiring.package; (&(osgi.wiring.package=io.fabric8.api)(version>=1.2.0)(!(version>=2.0.0))))
Copy to Clipboard Copied! Toggle word wrap Toggle overflow