4.5.1. Using Public Add-ons

An add-on published on Marketplace can be added to your project in one of the ways described below. The first and the second approaches assume that you use one of the standard CUBA repositories. The last approach is applicable for open-source add-ons and doesn’t involve any remote repositories.

By Studio
  1. Edit Project properties and on the App components panel click the plus button next to Custom components.

  2. Copy add-on coordinates from the marketplace page or from the add-on’s documentation and paste them in the coordinates field, for example:

    com.haulmont.addon.cubajm:cuba-jm-global:0.3.1
  3. Click OK in the dialog. Studio will try to find the add-on binaries in the repository currently selected for the project. If it is found, the dialog will close and the add-on will appear in the list of custom components.

  4. Save the project properties by clicking OK.

By manual editing
  1. Edit build.gradle and specify the add-on coordinates in the root dependencies section:

    dependencies {
        appComponent("com.haulmont.cuba:cuba-global:$cubaVersion")
        // your add-ons go here
        appComponent("com.haulmont.addon.cubajm:cuba-jm-global:0.3.1")
    }
  2. Execute gradlew idea in the command line to include add-on in your project’s development environment.

  3. Edit web.xml files of the core and web modules and add the add-on identifier (which is equal to Maven groupId) to the space-separated list of application components in the appComponents context parameter:

    <context-param>
        <param-name>appComponents</param-name>
        <param-value>com.haulmont.cuba com.haulmont.addon.cubajm</param-value>
    </context-param>
By building from sources
  1. Clone the add-on’s repository to a local directory and import the project into Studio.

  2. Execute CUBA > Advanced > Install app component main menu command to install the add-on to the local Maven repository (by default it is ~/.m2 directory).

  3. Open your project in Studio and add the local Maven repository to the repositories list in Project > Properties.

  4. On the App components panel, click the plus button next to Custom components and select the add-on in the drop-down list at the bottom of the dialog. The add-on’s coordinates will be shown in the field at the top.

  5. Click OK in the dialog and save the project properties.