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

Chapter 4. Locating Artifacts with Maven and HTTP


Abstract

In Red Hat JBoss Fuse, Maven is the primary mechanism for locating artifacts and dependencies, both at build time and at run time. Normally, Maven requires Internet connectivity, so that dependencies can be downloaded from remote repositories on demand. But, as explained here, it is also possible to provide dependencies locally, so that the need for Internet connectivity is reduced.

4.1. Locating HTTP Artifacts

Overview

You can specify the location of an OSGi bundle (and other kinds of resource) using a HTTP URL—for example, by specifying a HTTP URL as the argument to the osgi:install command. This approach is perhaps not as common as using Maven URLs, but it means that you have the option of providing OSGi resources through a Web server.

HTTP URL protocol

The HTTP URL protocol specifies the location of an OSGi bundle (or other resource) using a standard HTTP (or HTTPS) URL. Typically, a HTTP URL has a syntax like the following:
http[s]:Host[:Port]/[Path][#AnchorName][?Query]
Copy to Clipboard Toggle word wrap
In a standalone (non-Fabric) container, a HTTP URL lookup can be triggered by either of the following events:
  • When osgi:install is invoked on a Maven URL to install an OSGi bundle;
  • When features:install is invoked to install a Karaf feature (a Karaf feature typically includes one or more Maven URL references).

HTTP URL handler

JBoss Fuse uses Java's built-in HTTP protocol handler to resolve HTTP URLs. Hence, HTTP URL resolution behaves exactly as you would expect in standard Java.

Karaf bundle cache

When you pass a HTTP URL as the argument to the osgi:install command (or embedded in a Karaf feature description), JBoss Fuse downloads the referenced OSGi bundle resource, saves it in the Karaf bundle cache (under the data/cache directory), and loads the bundle into the Karaf container runtime. The Karaf bundle cache is used to persist all of the bundles currently installed in the Karaf runtime.
Note
When a Karaf container is stopped and restarted, it loads its installed bundles directly from the Karaf bundle cache, not from the local Maven repository (or anywhere else). Hence, if you have updated any artifacts in the local Maven repository in the meantime, those changes are not automatically reflected in the state of the Karaf container.

Configuring a HTTP proxy for HTTP URLs

To configure a HTTP proxy (which will be used when resolving HTTP URLs), open the InstallDir/etc/system.properties file in a text editor and set the http.proxyHost and http.proxyPort system properties with the host and port of the proxy—for example:
http.proxyHost=192.0.2.0
http.proxyPort=8080
Copy to Clipboard Toggle word wrap
You can optionally specify a list of non-proxy hosts (hosts that can be reached without going through the proxy) using the http.nonProxyHosts property—for example:
http.nonProxyHosts=localhost|*.redhat.com|*.jboss.org
Copy to Clipboard Toggle word wrap
Note
An advantage of using the system properties approach to configuring the proxy is that these settings will be used both by the mvn URL protocol handler and by the http URL protocol handler (see the section called “Configuring a HTTP proxy for Maven URLs”).
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

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

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

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

Red Hat 소개

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

Theme

© 2025 Red Hat