Environment:A2aproject A2a java Maven Build
| Knowledge Sources | |
|---|---|
| Domains | Infrastructure, Build |
| Last Updated | 2026-10-29 00:00 GMT |
Overview
Apache Maven 3.8+ build environment for compiling, testing, and packaging the A2A Java SDK multi-module project.
Description
The A2A Java SDK is a multi-module Maven project (`org.a2aproject.sdk` group) with a parent POM that manages all dependency versions, plugin versions, and build configuration. The build uses `maven-compiler-plugin` with `release=17`, `maven-enforcer-plugin` for constraint enforcement, `maven-surefire-plugin` for tests (with output redirected to files), `spotless-maven-plugin` for code formatting, and `error-prone` with `nullaway` for static analysis. The full build command is `mvn clean install`.
Usage
Use this environment for building the SDK, running tests, starting the Quarkus dev server (`mvn quarkus:dev`), and executing the K8s deployment scripts which invoke Maven to build the container image.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | Linux, macOS, or Windows | Any OS supporting Maven |
| JDK | 17+ | See Environment:A2aproject_A2a_java_Java_17_Runtime |
| Disk | 1GB free space | Maven local repository cache |
Dependencies
System Packages
- Apache Maven >= 3.8
- JDK 17+ (prerequisite)
Maven Plugins (managed by parent POM)
- `maven-compiler-plugin` = 3.16.0
- `maven-enforcer-plugin` = 3.6.2
- `maven-surefire-plugin` = 3.6.1
- `maven-source-plugin` = 3.4.0
- `maven-javadoc-plugin` = 3.12.0
- `spotless-maven-plugin` = 3.10.4
- `protobuf-maven-plugin` = 5.1.11 (for gRPC code generation)
Credentials
No credentials required for building. Publishing to Maven Central requires:
- `SONATYPE_USERNAME` — Sonatype Central Portal username
- `SONATYPE_PASSWORD` — Sonatype Central Portal password
- GPG key for artifact signing
Quick Install
# Install Maven (Ubuntu/Debian)
sudo apt install maven
# Verify
mvn --version
# Full clean build
cd /path/to/a2a-java
mvn clean install
# Build skipping tests (faster)
mvn clean install -DskipTests
# Run Quarkus dev server
cd examples/helloworld/server
mvn quarkus:dev
Code Evidence
Plugin versions from `pom.xml:46-58`:
<maven-compiler-plugin.version>3.16.0</maven-compiler-plugin.version>
<maven-enforcer-plugin.version>3.6.2</maven-enforcer-plugin.version>
<maven-surefire-plugin.version>3.6.1</maven-surefire-plugin.version>
<spotless-maven-plugin.version>3.10.4</spotless-maven-plugin.version>
Test output redirection from `pom.xml:92`:
<maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
K8s deployment script invoking Maven (`examples/cloud-deployment/scripts/deploy.sh`):
# Builds the server JAR before creating the container image
mvn -f ../server/pom.xml clean package -DskipTests
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| `BUILD FAILURE: Could not resolve dependencies` | Missing local artifacts | Run `mvn clean install` from root to install all modules |
| `ErrorProne compilation error` | NullAway found a null-safety violation | Add `@Nullable` annotation or fix null handling |
| `spotless check failures` | Code not formatted | Run `mvn spotless:apply` to auto-format |
| `Tests fail silently` | Test output redirected to file | Check `target/surefire-reports/` for logs |
Compatibility Notes
- Gradle: Not supported; the project is Maven-only.
- Maven 3.6 and below: May work but not tested; 3.8+ recommended.
- `skip.spotless=true`: Spotless is skipped by default in the parent POM; enable with `-Dskip.spotless=false`.