Skip to content

Examples

The plugwerk/examples repository ships two fully runnable reference applications. Each one stands a host application up next to a small Plugwerk server, publishes a couple of plugins, and demonstrates the install / use / uninstall loop end-to-end. Use them to see how the pieces fit together before wiring Plugwerk into your own application.

Example Host shape What plugins contribute Look at this first if you …
Java CLI Standalone Java CLI (picocli + PF4J DefaultPluginManager) New top-level subcommands … you are building a desktop / CI / batch tool and want plugins to add commands
Spring Boot + Thymeleaf Spring Boot web application with Thymeleaf views Menu entries + full HTML pages … you are integrating Plugwerk into an existing Spring Boot web application

Both examples share the same Plugwerk server (started locally via Docker Compose) and the same plugin lifecycle on the wire. They differ in where the plugin contributes its UI — a CLI subcommand on one side, a web page in the navigation bar on the other.

  • Java 21 or later
  • Docker and Docker Compose for the local Plugwerk server (a public SNAPSHOT image is pulled from GHCR — no docker login required)
  • A GitHub Personal Access Token with read:packages scope to resolve Plugwerk SNAPSHOT artifacts from GitHub Packages for Maven (only needed while the examples track SNAPSHOTs; not required when they pin to a Maven Central release)

The full bootstrap — start the server, create a namespace, mint an API key — is documented in the Quick start section of the plugwerk/examples README. Each example sub-page below references that flow rather than duplicating it.

Terminal window
git clone https://github.com/plugwerk/examples.git plugwerk-examples
cd plugwerk-examples

The repository root carries a Gradle composite build that drives both examples at once (./gradlew build builds them all). Each example also stands on its own as a self-contained Gradle project, so you can cd into one and build only that.

If you have not built a plugin yet, start with Plugin Lifecycle and the First plugin upload walkthrough first — both example projects assume you understand what a PF4J plugin ZIP is and how Plugwerk publishes one.