IntelliJ IDEA 2017.3 Help

OSGi and OSMORC

This feature is only supported in the Ultimate edition.

In this section:

Introduction

IntelliJ IDEA lets you create OSGi-based applications using Osmorc plugin. IntelliJ IDEA also lets you import Bnd/Bndtools projects. You can create a project with the OSGi support, add a module with the OSGI support to the existing project, or add the OSGi support to an existing module.

Prerequisite

Before you start working with OSGi, make sure that the Osmorc plugin is enabled. The plugin is bundled with IntelliJ IDEA and is activated by default. If the plugin is not activated, enable it on the Plugins settings page of the Settings / Preferences Dialog as described in Enabling and Disabling Plugins.

Creating a project or module with OSGi support

To create a project or module with OSGi support

  1. Do one of the following:
    • If you are going to create a new project: click Create New Project on the Welcome screen or select File | New | Project.

      As a result, the New Project wizard opens.

    • If you are going to add a module to an existing project: open the projectyou want to add a module to, and select File | New | Module.

      As a result, the New Module wizard opens.

  2. On the first page of the wizard, in the left-hand pane, select Java. In the right-hand part of the page, specify Project SDK and select OSGi from the list. In Libraries area specify OSGi library settings:
    • Use library - select this option to specify the existing OSGi library.
    • Download - select this option to download the library. You can click Configure to edit downloading options.
    • Set up library later - select this option to configure the library later in your project.

    Click Next.

  3. Specify the name and location settings. For more information, see Project Name and Location or Module Name and Location.

    Click Finish.

Adding OSGi support to the existing module

  1. In the project tree right-click the module to which you want to add the OSGi support.
  2. From the drop-down list select Add Framework Support.
  3. In the dialog that opens,from the left-hand pane, select OSGi.
  4. On the right side of the page, in the Libraries area, specify OSGi library settings.
    The OSGI library settings are as follows:
    • Use library - select this option to specify the existing OSGi library.
    • Download - select this option to download the library. You can click Configure to edit downloading options.
    • Set up library later - select this option to configure the library later in your project.
Last modified: 6 March 2018

See Also