Nuxeo CLI

Nuxeo CLI aims at making the whole development process easier with bootstraps for common Nuxeo components, sample projects to help you understand the hood and with the ability to trigger a hot reload of your developments in a running Nuxeo Server.

Commands

$ nuxeo <command> [options] [args]

Hot Reload

Triggering a hot reload on your server allows you to update some of your development modules without restarting the Nuxeo Server. To be done, it requires some simple modifications like to enable the sdk template in your nuxeo.conf file.

The first step is to associate a Nuxeo Server with your project root. Nuxeo CLI will ask you the distribution path and if you want to let it change nuxeo.conf file for you. Reexecute it to change the distribution path.

$ nuxeo hotreload configure

Then, you will be able to trigger a hot reload using:

$ nuxeo hotreload

Studio

Connect your Studio project to your bundle dependencies to be able to add it directly in your package or testing that everything is working well together.

Link your project to Studio:

$ nuxeo studio [link]

Unlink your project:

$ nuxeo studio unlink

Generate a Java Constant class with Studio's features:

$ nuxeo studio import

Export your local contributions to your studio project:

$ nuxeo studio export

Release your studio project (MINOR or MAJOR) on a given branch:

$ nuxeo studio release

Bootstrap

To prevent unpredictable behaviors always execute the FIRST bootstrap command from the root folder of your project.

Multiple Modules Empty Nuxeo Project

multi-module is the default generator when none is given as a parameter to nuxeo bootstrap.

Important Note

Using a Maven multiple modules architecture is the recommended way to bootstrap a new project: it allows to generate a Nuxeo Package afterwards to easily deploy your code on a Nuxeo Server instance. If a project is generated using a single module architecture, the Nuxeo Package needs to be created manually.

Parameters

Use a parent artifact: The parent artifact makes your project inherit dependencies, properties and other fields from another project. We recommend to keep the default value and use org.nuxeo.ecm.distribution:nuxeo-distribution.

Nuxeo Version: Asked only if no parent is specified. It specifies which Nuxeo version of the dependency management will be imported.

Empty Nuxeo Project

Set up an empty Nuxeo project; not recommended for project initialization.

$ nuxeo bootstrap single-module

Important Notes

You should use this command to initiate a project that stands in a single Maven module, without the need to be distributed with a Nuxeo Package. Otherwise, use the multi-module option instead so that you can generate a Nuxeo Package later on.

Parameters

Parent Group / Artifact: Like in multi-module, having a parent artifact enables project inheritance. If you are in a multi-module, you must set your parent module. If not, you can use org.nuxeo.ecm.distribution:nuxeo-distribution or org.nuxeo:nuxeo-addons-parent.

Nuxeo Version: Asked only if needed, it specifies which Nuxeo version of the dependency management will be imported.

Bare Component

Business Rules or Logic - Automation Operation

Event Bus Listener

Adds a listener with its test class. The events will be asked during the generation process. Both existing and custom events can be declared. You can create any listener type: pre-commit, post-commit, synchronous and asynchronous.

$ nuxeo bootstrap listener

Parameters

Trigger on events: List of some common events to bind to your listener.

Custom Events: In case you select 'custom events' in the previous list; comma separated list of other events.

Asynchronous Listener: If you need to run after the transaction has committed, in a new transaction and a separate thread. This is useful for any long-running operation whose result doesn't have to be seen immediately in the user interface.

Post-commit Listener: If you need to run after the transaction has committed, in a new transaction but in the same thread. This is useful for logging.

Nuxeo Package Module

Creates a module that generate a Nuxeo Package for your project. Can only be called in a Maven multi-module architecture, hence make sure to bootstrap your project using nuxeo bootstrap or nuxeo bootstrap multi-module. If you used nuxeo bootstrap single-module to bootstrap your project, you won't be able to call that option afterwards.

$ nuxeo bootstrap package

Sample

Discover a ready-to-use Nuxeo Project to help you understand tricky components like BlobProvider: