Serverless Maven Plugin

The Serverless Maven Plugin lets you define an entire serverless application as a single, cloud-agnostic JSON configuration and deploy it straight from your Maven build. Describe the components you want — websites, APIs, functions, databases, authentication, messaging, and more — and the plugin provisions the underlying cloud resources, wires up the permissions between them, verifies their health, and tears them down again, all as ordinary Maven goals.

One configuration file. One build tool. Deploy the same application to AWS, Azure, or GCP by changing a single provider field.

What It Can Do

Declarative

Infrastructure as configuration

Declare your application's components in JSON. No scripting, no per-resource boilerplate — the plugin figures out how to create each resource.

Multi-cloud

AWS, Azure & GCP

The same component model targets all three major clouds. Switch providers with the provider field instead of rewriting your stack.

Automatic

Permissions & wiring

Links between components (a function reading a database, a website calling an API) generate least-privilege IAM/RBAC permissions for you.

Lifecycle

Validate, plan, deploy, verify, undeploy

Five Maven goals cover the full lifecycle, with prerequisite phases run automatically and health checks after deploy.

Safe

Validated before deploy

Configuration is parsed and validated up front — unknown fields, invalid links, and bad resource names are caught before any cloud call is made.

Composable

Rich component library

Websites, storage, API gateways (HTTP & WebSocket), functions, databases, authentication, email, SMS, event buses, and WAF geo-protection.

Components You Can Deploy

Component
What it provisions
Static site with CDN and path-based storage routing.
Object storage buckets, with optional artifact uploads.
HTTP REST APIs and real-time WebSocket APIs backed by functions.
Serverless functions with a dedicated execution identity and explicit permissions.
Serverless NoSQL tables.
A managed user identity provider with groups and users.
Transactional email sending.
Transactional SMS sending.
Asynchronous pub/sub event routing between functions.
Web application firewall with geo detection and country-based access control.

How It Works

You write a configuration file (by default src/main/serverless/config.json) describing your application, its target provider, and the regions and components to deploy. Relationships between components are declared as links, and the plugin translates each link into the exact permissions the source component needs on the target. Running a Maven goal then drives the lifecycle:

Goal
Description
serverless:validate
Parse and validate the configuration.
serverless:plan
Diff the desired state against what is deployed.
serverless:deploy
Provision and wire up all components.
serverless:verify
Health-check the deployed resources.
serverless:undeploy
Tear everything down.

Where to Go Next