Skip to content
This repository has been archived by the owner on Jun 26, 2021. It is now read-only.

Overriding The Workflow

Stanley Hillner edited this page Aug 5, 2016 · 3 revisions

Every goal of this depends on the CDI-enabled base goal and uses dependency injection to provide data to its processing steps as well as a default workflow to orchestrate all necessary processing steps for the desired business logic.

A key concept not only of this plugin but rather of the base library (Maven CDI Plugin Utils) is to provide extensibility for Maven Plugins out of the box. Therefore the workflow concept has been introduced which allows plugin goals to declare a default workflow which can then be overridden by users of the goal at runtime. Overriding can mean to simple reorganize the processing steps or skip an unnecessary step but it can also mean to extend the default workflow with further steps which is discussed here.

Printing The Default Workflow

In order to extend the default workflow it is necessary to know it. It is possible to print the default workflow for each goal which can be done with the following command for the [perform|unleash:perform] goal:

mvn unleash:perform -DprintWorkflow

Overriding The Workflow

Workflow overriding is simply done by storing your adapted workflow in a file and passing the path of this file as a system property to the plugin goal. This can be done like this and is documented here:

mvn unleash:perform -Dworkflow=<path_to_your_workflow>

You can check if the goal uses the correct workflow (your customized one instead of the default one) by either observing the log output during the build run. If your workflow has been loaded correctly the following line will occur there:

[INFO] 15:17:14,525 Workflow of goal 'cdi-test:test1' will be overriden by file '<path_to_your_workflow>'.

Another option the verify that the goal takes your workflow is to print the currently used workflow only instead of running the processing logic:

mvn unleash:perform -Dworkflow=<path_to_your_workflow> -DprintWorkflow

The Workflow Format

Workflows are simple text files which may list each processing step id on a separate line or declaring parallel execution of processing steps. It is also possible to declare steps multiple times and dispatch their processing using qualifiers. The whole workflow format which is still evolving is explained on the Workflow Format wiki page of the base library.