Prerequisites
Before starting, ensure you have:- A repository under the
spring-ai-communityGitHub organization - Maven wrapper (
./mvnw) in your repository root — if missing, runmvn wrapper:wrapperto generate it - Standard Maven project structure
- Repository admin access (for configuring secrets)
Step 1: Add CI Workflow
Create.github/workflows/ci.yml in your repository:
clean verify -B on every push and PR. Optional inputs:
| Input | Default | Description |
|---|---|---|
java-version | 17 | Java version |
java-distribution | temurin | Java distribution |
maven-goals | clean verify -B | Maven goals to run |
skip-tests | false | Skip tests |
upload-test-results | true | Upload Surefire reports as artifacts |
Step 2: Add Snapshot Publishing
Create.github/workflows/publish-snapshot.yml:
main publishes a SNAPSHOT to Maven Central. This requires the MAVEN_USERNAME and MAVEN_PASSWORD secrets (see Secrets Configuration).
Step 3: Add Release Workflow
Create.github/workflows/release.yml:
- Sets the POM version to the specified release version
- Verifies no SNAPSHOT dependencies remain
- Builds and runs tests
- Deploys to Maven Central with GPG signing (using the
releaseprofile) - Creates a Git tag (e.g.,
v0.1.0) and GitHub Release
| Input | Default | Description |
|---|---|---|
java-version | 17 | Java version |
skip-tests | false | Skip tests |
create-tag | true | Create and push a Git tag |
tag-prefix | v | Tag prefix (e.g., v produces v0.1.0) |
Secrets Configuration
Organization-Level Secrets (Already Configured)
These secrets are set at the GitHub organization level. Your repository needs to be granted access to them (ask an org admin if they aren’t available):| Secret | Description |
|---|---|
MAVEN_USERNAME | Sonatype Central Portal username |
MAVEN_PASSWORD | Sonatype Central Portal token |
GPG_SECRET_KEY | ASCII-armored GPG private key |
GPG_PASSPHRASE | GPG key passphrase |
Repository-Level Secrets
If your project uses CLI tools for integration tests, set these at the repository level (Settings → Secrets and variables → Actions):| Secret | Description | Required By |
|---|---|---|
ANTHROPIC_API_KEY | Anthropic API key for Claude CLI | Projects using Claude CLI |
GEMINI_API_KEY | Google API key for Gemini CLI | Projects using Gemini CLI |
Repository-level secrets keep API keys scoped per-project for billing and access control. Do not set API keys at the organization level.
POM Requirements
The release workflow deploys with-Prelease, which activates a Maven profile that handles Central Publishing, GPG signing, and source/javadoc JAR generation.
- Using community-parent (recommended)
- Without community-parent
If your project inherits from This gives you the full release profile automatically —
community-parent, the release profile is already provided. Just add the parent to your POM:central-publishing-maven-plugin, maven-gpg-plugin, maven-source-plugin, and maven-javadoc-plugin are all preconfigured. It also provides distributionManagement for snapshot publishing.You must add the Central snapshots repository so Maven can resolve the parent POM:Performing a Release
Option A: GitHub Actions UI (workflow_dispatch)
This is the primary release method:Option B: Release Script (CLI)
For command-line releases, use the release script from thecommunity-workflows repository:
Option C: PR-Based Releases (Optional)
For projects that prefer PR-driven releases, copy.github/project.yml.template from community-workflows to .github/project.yml in your repository:
pr-based-releases is set to true, merging a PR that changes release.current-version to a non-SNAPSHOT version (e.g., 0.1.0) automatically triggers the release workflow.
Projects Using Shared Workflows
| Project | Description | Workflow Type |
|---|---|---|
| agent-sandbox | Sandbox for secure code execution | Simple |
| agent-judge | Judge framework for evaluating AI outputs | Simple |
| agent-client | Agent client for Spring AI | With CLI |
| claude-agent-sdk-java | Claude Code SDK for Java | With CLI |
| spring-ai-replicate | Spring AI integration for Replicate | Simple |
CLI Tools Variant
Projects that require CLI tools (Claude, Gemini, Vendir) for integration tests should use the-with-cli workflow variants. These add:
- Node.js setup and CLI installation
- API keys passed as environment variables to Maven
- Optional commit message validation (blocks AI attribution markers)
-with-cli variants are available for all three workflows: ci-build-with-cli.yml, publish-snapshot-with-cli.yml, and maven-central-release-with-cli.yml.
Additional inputs for CLI variants:
| Input | Default | Description |
|---|---|---|
install-claude-cli | false | Install Claude Code CLI |
install-gemini-cli | false | Install Gemini CLI |
install-vendir-cli | false | Install Vendir CLI |
vendir-version | 0.44.0 | Vendir version to install |
validate-commits | false | Check commits for AI attribution markers |
Troubleshooting
Secrets not available in workflow
Secrets not available in workflow
Organization-level secrets must be explicitly granted access to your repository. Ask an org admin to add your repository to the secret’s access list under Organization Settings → Secrets → Repository access.
Non-resolvable parent POM
Non-resolvable parent POM
If CI fails with
Non-resolvable parent POM for ... spring-ai-community-parent, your POM is missing the Central snapshots repository. Add it to your repositories section:SNAPSHOT references found during release
SNAPSHOT references found during release
The release workflow checks that no POM files contain SNAPSHOT references after setting the release version. If you have SNAPSHOT dependencies on other community projects, those projects must be released first.
GPG signing fails
GPG signing fails
Ensure the The entire contents of
GPG_SECRET_KEY secret contains the full ASCII-armored private key. Export it with:private-key.asc (including the BEGIN and END lines) should be the secret value.Maven Central deployment fails
Maven Central deployment fails
Verify your credentials work by logging in at central.sonatype.com. Try publishing a SNAPSHOT first to confirm the credentials are valid.
CLI tools not found during build
CLI tools not found during build
Ensure you’re using the
-with-cli workflow variant and have set the install-* inputs to true. Check that the corresponding API key secrets are configured at the repository level.