At run time the container strikes a balance between accessing artifacts locally and downloading artifacts from remote repositories. The container will first search all systems local to the container. If it cannot locate the artifacts in a local repository, it will then search remote repositories.
For default features, the artifacts are always stored in the container's system repository. For non-default features, third party bundles, or customer developed bundles, it is likely that Maven will need to search remote repositories to locate the artifacts.
Figure 6 shows an overview of the procedure that Fuse ESB Enterprise follows when a feature or bundle is installed at run time.
The steps followed to locate the required Maven artifacts are:
The container searches for artifacts in the system repository.
This repository contains all of the artifacts provided with the Fuse ESB Enterprise installation. The system repository is located at
.EsbInstallDir/systemIf an artifact is not available in the system repository, the container searches any other configured default repositories.
Fuse ESB Enterprise allows you to specify one or more repositories into which you can place artifacts. For example, you could use a shared folder as a default repository that provides an easy way to distribute bundles to remote machines. See Default repositories for details on configuring the default repositories.
If the artifact is not available in the default repositories, the container searches the Maven local repository.
The default location of the local repository is the
.m2/repository/directory under the user's home directory. See Local repository for details on configuring the local repository.If the artifact is not available in any of the local repositories, the container searches the remote repositories specified in the Fuse ESB Enterprise configuration.
The remote repositories are specified by the
org.ops4j.pax.url.mvn.repositoriesproperty in theorg.ops4j.pax.url.mvn.PID. See Remote repositories for details on configuring the remote repositories that the container will check.![[Note]](imagesdb/note.gif)
Note If an artifact is found in a remote repository, it is automatically downloaded and installed into the local repository.
The default repositories are a list of repositories that the container always checks
first. The list is specified by the org.ops4j.pax.url.mvn.defaultRepositories
in the org.ops4j.pax.url.mvn PID. The property's initial setting is a single
entry for the container's system repository as shown in
Example 5.
Example 5. Initial Setting for a Container's Default Repositories
org.ops4j.pax.url.mvn.defaultRepositories=file:${karaf.home}/${karaf.default.repository}@snapshotsThe org.ops4j.pax.url.mvn.defaultRepositories property is a comma-separated
list, so you can specify multiple default repositories. You can specify the repository
location using a URL with a file:, http:, or https:
scheme. You can optionally add the following suffixes to the URL:
@snapshots—allow snapshot versions to be read from the repository@noreleases—do not allow release versions to be read from the repository
![]() | Tip |
|---|---|
It is recommended that you leave the container's system repository as the first entry in the list. |
The container resolves the location of the local repository in the following manner:
Use the location specified by the
org.ops4j.pax.url.mvn.localRepository.localRepositoryproperty in theorg.ops4j.pax.url.mvnPID.Otherwise, use the location specified by the
localRepositoryelement in thesettings.xmlfile specified by theorg.ops4j.pax.url.mvn.localRepository.settingsproperty in theorg.ops4j.pax.url.mvnPID.Otherwise, use the location specified by the
localRepositoryelement in the.m2/settings.xmlfile located under the user's home directory.Otherwise, use the location specified by the
localRepositoryelement in thefile.M2_HOME/conf/settings.xmlOtherwise, the default location is
.m2/repository/under the user's home directory.
The remote repositories checked by the container are specified by the
org.ops4j.pax.url.mvn.repositories property in the
org.ops4j.pax.url.mvn PID. The repositories are specified as a
comma-separated list as shown in Example 6.
Example 6. Setting a Container's Remote Repositories
org.ops4j.pax.url.mvn.repositories= \
http://repo1.maven.org/maven2, \
http://repo.fusesource.com/maven2, \
http://repo.fusesource.com/maven2-snapshot@snapshots@noreleases, \
http://repo.fusesource.com/nexus/content/repositories/releases, \
http://repo.fusesource.com/nexus/content/repositories/snapshots@snapshots@noreleases, \
http://repository.apache.org/content/groups/snapshots-group@snapshots@noreleases, \
http://repository.ops4j.org/maven2, \
http://svn.apache.org/repos/asf/servicemix/m2-repo, \
http://repository.springsource.com/maven/bundles/release, \
http://repository.springsource.com/maven/bundles/externalYou can optionally add the following suffixes to the URsL:
@snapshots—allow snapshot versions to be read from the repository@noreleases—do not allow release versions to be read from the repository






![[Tip]](imagesdb/tip.gif)


