Developer Tools

Select your preferred language (Java/Scala) above.

The Java tooling is published to Maven Central.

Maven archetype

A Maven archetype; akkaserverless-maven-archetype provides the tooling to kickstart a Maven project. You supply details such as the desired artifact and group IDs, and the archetype provides a new Maven project directory with the Akka Serverless SDK and associated development support tooling set up.

The archetype can be used via the mvn CLI.

Linux or MacOS
mvn \
  archetype:generate \
  -DarchetypeGroupId=com.akkaserverless \
  -DarchetypeArtifactId=akkaserverless-maven-archetype \
  -DarchetypeVersion=0.9.0
Windows
mvn ^
  archetype:generate ^
  -DarchetypeGroupId=com.akkaserverless ^
  -DarchetypeArtifactId=akkaserverless-maven-archetype ^
  -DarchetypeVersion=0.9.0

Ongoing development support

The development support tooling is provided via a single Maven plugin; akkaserverless-maven-plugin. This plugin provides two Maven goals to support Protobuf driven interface-first development.

Goals

This plugin implements the following Maven Build Lifecycle goals:

  • generate; generates implementation stubs for your entity/service and corresponding tests, as well as an abstract class for your implementation to extend. If you make further updates to your Protobuf specification after the initial generation, existing implementation is left unchanged but the abstract class is updated to align. This allows you to leverage native developer tooling to guide the desired changes.

  • deploy; simply invokes the akkasls command line tool to deploy the service to Akka Serverless. This relies on an existing installation of the CLI and uses configuration and credentials from that installation.

The deploy goal requires the Akka Serverless CLI to be installed on your system.

Configuration

The behaviour of the plugin can be adjusted by adding a <configuration> tag to the plugin definition in your POM with any of the following options:

  • akkaslsPath path and name of the akkasls commmand line tool

  • akkaslsContext selects the context when calling akkasls if set

  • dockerImage the Docker image name (use eg. <dockerImage>${akkasls.dockerImage}:${akkasls.dockerTag}</dockerImage>)

sbt Giter8 template

A Giter8 template; lightbend/akkaserverless-value-entity.g8 provides the tooling to kickstart an sbt project. The Giter8 template can be used via the sbt CLI.

sbt new lightbend/akkaserverless-value-entity.g8

Ongoing development support

The development support tooling is provided via an sbt plugin; sbt-akkaserverless. This plugin provides commands to support Protobuf driven interface-first development.

Commands

The sbt plugin hooks into the standard sbt commands for compiling, testing, and packaging. Code is automatically generated from Protobuf interfaces when using compile, test:compile, test, and other commands that depend on these commands. The sbt-native-packager plugin is included in the Giter8 template, which can be used for building and publishing Docker images, respectively using the docker:publishLocal and docker:publish commands.

Configuration

The behaviour of the plugin can be adjusted, by specifying system properties when starting sbt with a -D flag, for the following options:

  • The docker.username sets the username used to publish the image, for example sbt -Ddocker.username=myuser docker:publish.

  • The docker.registry sets the docker registry to publish to, which is only needed for a docker registry other than docker hub.