Configuring OSGi bundle repositories

About this task

Important: Applicable to WebSphere® Application Server traditional

OSGi bundle repositories are external collections of bundles that are described in a repository XML file. If your OSGi application requires bundles provided in external repositories to compile correctly, you can configure your workspace to load the bundles. You can also deploy the bundle repository description to your server so that the server can access the required bundles after your application is deployed.

The following steps describe how you can access the OSGi bundle repositories view and learn the options for configuring bundle repositories.

Procedure

  1. Access the bundle repositories view.
    Click Window > Show View > Other > OSGi > OSGi Bundle Repositories. The OSGi bundle repositories view is opened in your workspace.
  2. Add a repository.
    Right-click the OSGi Bundle Repositories icon. Select Add Repository. The New OSGi Bundle Repository dialog is displayed. Enter the information that is required for the repository and click OK when finished:
    Repository URL
    The URL for the repository description file. The repository description file can be available on a network over HTTP or it can be on your local file system. If the file is available over HTTP, enter the URL and click Load. If the file is local, click Local and browse to the file.
    Note: For files available over HTTP, the OK button in the dialog will be disabled until the file is loaded successfully.
    Target Platform
    The target platform that you want to compile your application against. For example, WebSphere Application Server v8.5.
  3. Select the bundles that you want to load from the repository that you added.
    You can select multiple bundles by holding down the Ctrl key while you select.
  4. Load bundles.
    Right-click the selected bundles and click Load Bundle. Loading a bundle caches a copy of the bundle in the .metadata folder of your workspace so that projects that require the bundle compile correctly.
    Note: The bundle is not visible in the projects view of your workspace.
    Note: Finding bundles to load by service

    If a bundle has a service that uses an API in another bundle and you want to load the bundle that contains the API, you can quickly identify and load that bundle. Expand the bundle that contains the service. Right-click the service and select Load Service API.... The Load service API bundle dialog displays the bundles that contain the APIs used by the service. Select the bundles that you want to load, and click OK.

  5. Deploy a bundle repository description to the server.
    If you want your server to be able to access bundles in a bundle repository that are required by your application, deploy the bundle repository description to the server. Right-click the bundle repository that you added and select Deploy to Server.
  6. Explore other actions in the bundle repository view.
    Other actions available in the bundle repository view are Associate Target, Refresh, and Delete. To access these actions, right-click an existing bundle repository. Descriptions for these actions are in the following list:
    Associate Target
    Change the target platform that you want to compile your application against. For example, WebSphere Application Server v8.5.
    Refresh
    If you changed the bundles on a repository, click Refresh to load the latest versions of the bundles.
    Delete
    Click Delete to remove a repository from the bundle repository view.