4.6.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
-
-
Edit Project properties and on the App components panel click the plus button next to Custom components.
-
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
-
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.
-
Save the project properties by clicking OK.
-
- By manual editing
-
-
Edit
build.gradle
and specify the add-on coordinates in the rootdependencies
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") }
-
Execute
gradlew idea
in the command line to include add-on in your project’s development environment. -
Edit
web.xml
files of thecore
andweb
modules and add the add-on identifier (which is equal to Maven groupId) to the space-separated list of application components in theappComponents
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
-
-
Clone the add-on’s repository to a local directory and import the project into Studio.
-
Execute Run > Install app component main menu command to install the add-on to the local Maven repository (by default it is
~/.m2
directory). -
Open your project in Studio and select the Use local Maven repository checkbox on the Advanced tab of the Project properties page.
-
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.
-
Click OK in the dialog and save the project properties.
-