Build Cloudflow Applications using Maven

The default build tool for Cloudflow applications is sbt but there is support for using Maven to build as well.

In the examples directory you can find some reference projects compiled with Maven. Folders are marked with a mvn- prefix.

The Cloudflow maven plugin can be included in the plugins section:


For Docker we support and integrate the workflow with fabric8 docker-maven-plugin.

Maven Workflow

Using a Cloudflow Maven project you can use the following Maven goals:

  1. package your application in a .jar

  2. cloudflow:extract-streamlets to make the Streamlets implementation available for the next steps

After using the goals mentioned above, you can perform a few interesting commands to analyze and develop your application locally:

  • cloudflow:verify-blueprint will verify that the provided blueprint.conf is valid

  • cloudflow:app-layout will print the graph of interconnections of the streamlets

  • cloudflow:run-local will run the application on forked JVMs locally

To deploy your application to a cluster you instead need the following steps:

  1. docker:build to build the docker images

  2. cloudflow:push-images to push the images to a Docker registry, returning information about the published image digests

If not specifically configured in your POM, the default image registry used by the fabric8 docker-maven-plugin is To use a different registry, you’ll need to provide a proper <registry> subelement to your configuration. For more information, please see Registry handling.
  1. cloudflow:build-app to produce the deployable CR file in the topLevel project target directory

Full example

A full example of using the Maven commands is shown below:

  1. Set the $DOCKER_USERNAME and $DOCKER_PASSWORD environment variables to the username and password of your image registry.

    To avoid storing your credentials in the shell’s history file, use the following commands to create an environment variable for username and password. The username/password are your credentials to the Lightbend docker repository - If you want to see the password, remove the -s (for silent) flag.
      read -s DOCKER_PASSWORD
  2. Then execute the following:

    mvn clean
    mvn \
      package \
      cloudflow:extract-streamlets \
      docker:build \
      cloudflow:push-images \
      -Ddocker.username=${DOCKER_USERNAME} \
      -Ddocker.password=${DOCKER_PASSWORD} \
    mvn cloudflow:build-app
  3. After executing the above maven commands, you are ready to deploy your application to a cluster using:

    kubectl cloudflow deploy ./target/<your-application-name>.json


You can easily generate a full project with akka streamlets using the Cloudflow Maven Archetype:

mvn archetype:generate -DarchetypeGroupId=com.lightbend.cloudflow \
  -DarchetypeArtifactId=cloudflow-archetype \
  -DarchetypeVersion=2.3.1 \
  -DgroupId=<groupId> \
  -DartifactId=<appId> \


The Maven plugin exposes some configuration keys that can be used to tweak the behavior. You can apply those by adding a configuration section such as:


The available configurations for the goal cloudflow:run-local are:



Specify an alternative configuration file to be used in run-local



Specify an alternative log4j configuration file to be used in run-local



The initial port to be used for exposing JMX debugging



Enable JMX debugging during run-local