This content is dedicated to our next version. It is work in progress: its content will evolve until the new version is released. Before that time, it cannot be considered as official.

Configure Maven from Bonita Studio

This page explains how to configure Maven from Bonita Studio. You have the possibility to add repositories, servers, proxies, and mirrors, and also to encrypt your passwords from the UI.

The Bonita Studio user interface allows you to edit the maven configuration file (usually located at ~/.m2/settings.xml).
All the concepts are explained in the official maven documentation.

Add a new Maven repository

Repositories declared in your configuration are the remote repositories Maven use to populate your local repository, which is used by Maven to retrieve plugins and dependencies.
Concretely, it means that to add an extension to your Bonita project (a connector, a REST API extension…​) you have to add the Maven repository that contains your extension in your configuration. Thus, Maven will be able to access this repository and retrieve your extension.

If your artifacts are published on maven central, you do not need to add any extra configuration, it is the default repository used by Maven.
You might need to configure a Proxy if you are behind a firewall.

To configure a new Maven repository, click on Preferences (from the coolbar) → Extensions, and select the tab Repositories.

You can add a new Repository to the selected profile by clicking on the Add button, or edit an existing one by selecting it.
The UI offers the possibiliy to edit the ID, the name and the URL of the repository, and to define policies for Releases and Snapshots artifacts.
If you need to configure credentials for your repository, you’ll have to create a Server that references this repository ID.
The UI does not offer the possibility to add and configure plugin repositories, since they are not used by Bonita.

Add a new Maven server

Servers are used to store credentials for the repositories / mirrors Maven might try to connect.
A server references the ID of a repository / mirror, and the credentials for this element.
Credentials can be username/password or privateKey/passphrase if you use ssh to connect to the remote repository.

If you use a private key to login to the server (ssh), make sure that the password field is empty. Otherwise, the key will be ignored.

To configure a new Maven server, click on Preferences (from the coolbar) → Extensions, and select the tab Servers.

You can add a new Server by clicking on the Add button, or edit an existing one by selecting it.
The UI offers the possibility to select the ID of an existing repository / mirror for this server, to select the authentication mode and to store the credentials.
The UI does not offer the possibility to edit directory and file permissions since we do not perform Maven deployment from Bonita.

Maven support password encryption, so does Bonita.
It is recommended to use password encryption when Maven settings are shared.
To encrypt a password, you must first define a master password, at the top of the UI. This master password is saved in ~/.m2/settings-security.xml, and is used as an encryption key to encryt and decrypt other passwords. It means that you cannot decrypt an encrypted password without the master password. So if your passwords are encrypted, you can share the settings file freely, it won’t be possible to use them without the master password (which should never be shared).
Once you defined a master password (automatically encrypted using an internal maven key), you can encrypt your passwords using the encrypt button in the UI.

If you update the master password, all passwords have to be encrypted again.

Add a new Maven proxy

You can configure a proxy to use for some or all of your HTTP requests with Maven.

To configure a new Maven proxy, click on Preferences (from the coolbar) → Extensions, and select the tab Proxies.

You can add a new Proxy by clicking on the Add button, or edit an existing one by selecting it.
Protocol, Host and Port refers to the protocol://host:port of your proxy.
The field nonProxyHosts refers to the list of hosts that should not be proxied. The delimiter of the list is the expected type of the proxy server, usually a pipe or a comma.
You can configure credentials if your proxy requires authentication. It is recommended to encrypt your passwords if the maven configuration file is shared.
You might need to define several proxies, but keep in mind that only one proxy can be active at a time. To activate a proxy, select it on the list and click on the button activate.

Add a new Maven mirror

Maven offers the possibility to configure mirrors for some or all your repositories.

To configure a new Maven mirror, click on Preferences (from the coolbar) → Extensions, and select the tab Mirrors.

You can add a new Mirror by clicking on the Add button, or edit an existing one by selecting it.
A mirror is defined by an ID, a name, an URL and a field mirrorOf.
The ID is used by servers to reference the mirror if it is protected by authentication.
The URL is simply the base URL of the mirror, used by maven to connect to a repository rather than the original repository URL.
The field mirrorOf reffers to the id of the repository that this is a mirror of. Advanced use cases are supported, like using * to mirror all repositories.