Set up a project with an OSGi plugin module

An OSGi plugin module must be in a project. Follow this procedure to create a project or use an existing empty project.

About this task

After you run the gwb pluginStudio command for the first time for a Guidewire product, IntelliJ starts with an empty workspace and no current project. You must create a project to contain your OSGi plugin. If you have previously run IntelliJ IDEA with OSGi Editor and have created an empty project, you can use that project. If you have a project that contains files, you must create a new project.

Procedure

  1. Open a command prompt in the application root directory.
  2. Generate the Java API libraries by typing the following command.
    gwb genJavaApi
  3. Launch IntelliJ with OSGi Editor by typing the following command.
    gwb pluginStudio
  • If you have previously run IntelliJ IDEA with OSGi Editor and have an empty project that you want to use, do this step.
    1. To add or import an OSGi module to an existing empty project, perform the following steps:
      1. In the Project Structure dialog, select Empty Project and set the Project name field.
      2. Add a module in the Project Structure dialog by clicking the plus sign (+).
      3. For a new module, choose New Module, and then select the module type OSGi Plugin Module. In the Module name field, type the module name. Go to Step 6.
      4. To select an existing module to import, choose Import Module.
      5. Click Next repeatedly and confirm the settings for the imported module.
      6. Click Finish.
      7. Click OK.
        You do not do the remaining steps in this procedure.
  • If you do not have an empty project, you must create a new project by doing all the following steps.
    1. To create a new project, perform the following steps:
      1. To create the first project in IntelliJ IDEA with OSGi Editor, click Create New Project. If IntelliJ starts with an existing project, click File > New Project.
      2. In the list of module types, click Guidewire and then, in the main panel of the dialog box, click OSGi Plugin Module.
      3. Click Next.
      4. In the Project name field, type the project name. In the Project location field, type the project location.
        Do not yet click Finish.
    2. Change the settings on the new module.
      1. Open the More Settings pane, if it is not already open.
      2. Set the name of the new module as appropriate.
        By default, the Bundle Symbolic Name field matches the name of the module.
      3. Optionally, change the symbolic name to a different value.
        The bundle symbolic name defines the main part of the output JAR file name before the version number.
      4. Optionally, change the version of the bundle in the Bundle Version field.
    3. Click Finish.
      If IntelliJ started with an existing project, you must choose whether to replace that project in the current window or open a new IntelliJ window.
    4. If this is a new project, you must set the project JDK.
      1. Click File > Project Structure.
      2. In the Project Settings > Project section, set the Project SDK picker to your Java JDK.
      3. If there is no Java JDK listed, click the New button. Click JDK, and then navigate to and select the Java JDK that you want to use. Next, set the Project SDK picker to your newly created Java JDK configuration.
      4. Click OK.

    What to do next