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
-
If you are using CUBA Studio 11+, manage add-ons via CUBA Add-Ons window as described in the Studio documentation.
For the previous CUBA Studio versions, follow the steps below:
-
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") }
-
Refresh Gradle project in your IDE, e.g., by clicking CUBA → Re-Import Gradle Project in the Studio main menu, 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 CUBA > Advanced > 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 add the local Maven repository to the repositories list in Project > Properties.
-
Install the add-on into the project using the CUBA Add-ons dialog in Studio. For details, see Installing add-on by coordinates in the Managing Add-ons section of the Studio User Guide.
-
Click OK in the dialog and save the project properties.
-
If a project uses more than one add-ons having a web-toolkit module, then the project must have web-toolkit module too. If not, then only one widgetset from one add-on is loaded in the application. So the web-toolkit module is needed to integrate all widgetsets from used add-ons. |