Maven plugin

Invoking Fluxtion compiler from maven

Introduction

Invoking Fluxtion as a standalone tool can have various difficulties attached to it. Wrapping the use of Fluxtion as a maven plugin has the following advantages:

  • Fluxtion generation becomes part of the standard build process.

  • No need to construct complex command line arguments.

  • Input and output files reside in standard locations.

  • Automation reduces developer effort and sources of error.

Executing Fluxtion in maven

The tool steps a user should follow to execute the Fluxtion event stream compiler via maven are :

  • Create a maven project declaring Fluxtion libraries as dependencies.

  • Write application classes representing nodes and events to fulfill event processing requirement.

  • Create meta-data describing the construction of the execution graph.

  • Add the Fluxtion maven plugin to the build plugins, setting configuration.

  • Run a mvn build.

The maven plugin is released to maven central and should be available without setting repositories.

Fluxtion dependencies

Fluxtion has two libraries the user needs to declare in the dependency section, the libraries are described here. The builder library is not required in the final application, to remove the builder from the runtime set of dependencies specify the scope as provided. An example valid dependency section:

Develop SEP processor

Application event processing and graph description are covered in the event processing and graph building section.

Add Build plugins

Add the maven Fluxtion plugin to the plugins section of the build. The plugin in by default binds to the compile phase of the maven build cycle. Fluxtion will use if available the parameter meta-data supplied at compile time by javac, add the -parameters switch to the compiler plugin to add the meta-data.

A sample section plugin declaration in a project using Fluxtion:

Configure plugin

The plugin acts as a pass through to the Fluxtion compiler supplying configuration to the tool as well. The configuration available for the fluxtion maven plugin can be printed to the console, using mvn help:describe -Dplugin=com.fluxtion:fluxtion-maven-plugin -Ddetail example shown below:

Run build

running the build will invoke maven as part of the standard build cycle in the compile phase:

Note

line 17 is the command needed to run the Flxutiion generator for this project configuration using the fluxtion.jar directly without maven.

Last updated

Was this helpful?