検索

このコンテンツは選択した言語では利用できません。

Chapter 5. Offline Mode

download PDF

You can run the Apache Karaf container in offline mode (that is, without an Internet connection). But if you are planning to deploy custom applications to the container, it might be necessary to download additional dependencies to a local Maven repository before you can run the container in offline mode with these applications.

To run the Apache Karaf container in offline mode, it is necessary to distinguish between the following kinds of dependency:

  • Runtime dependencies — the dependencies required to run the Apache Karaf container, in its default configuration.
  • Build-time dependencies — the dependencies required to build a custom application (which might include third-party libraries).

Here is a summary of what can be done in offline mode and what needs to be done in online mode (with an Internet connection):

  • Running the Apache Karaf container in its default configuration — is supported in offline mode. The default configuration of the Apache Karaf container is specified by the featuresBoot property in the etc/org.apache.karaf.features.cfg file. The requisite dependencies are all provided in the system/ sub-directory of the installation.
  • Installing additional features — is, in general, not supported in offline mode. In principle, you can use the features:install command to install any of the features from the standard feature repositories (as specified by the featuresRepositories property in the etc/org.apache.karaf.features.cfg file), but the majority of these features must be downloaded from the Internet and are thus not supported in offline mode.
  • Deploying custom applications — is, in general, not supported in offline mode. There may be some cases where an application with a minimal set of build-time dependencies is deployable offline, but in general, custom applications would have third-party dependencies that require an Internet connection (so that JAR files can be downloaded by Apache Maven).

If you do need to deploy an application with dependencies that are not available offline, you can use the Maven dependency plug-in to download the application’s dependencies into a Maven offline repository. This customized Maven offline repository can then be distributed internally to any machines that do not have an Internet connection.

5.1. Download repository for Maven project

From the project directory that contains the pom.xml file, run the following Maven command:

mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.0:go-offline -Dmaven.repo.local=/tmp/foo

All the Maven dependencies and plug-ins required to build the project will be downloaded to the /tmp/foo directory.

5.2. Enable offline mode

To enable offline mode you must edit etc/org.ops4j.pax.url.mvn.cfg. Find the setting org.ops4j.pax.url.mvn.offline and replace the default false with true.

##
# If set to true, no remote repository will be accessed when resolving artifacts
#
org.ops4j.pax.url.mvn.offline = true
Red Hat logoGithubRedditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

© 2024 Red Hat, Inc.