Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
25 changes: 25 additions & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Check Formatting

on:
push:
pull_request:
workflow_dispatch:

concurrency:
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
formatting:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Set up JDK 25
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6
with:
java-version: '25'
distribution: 'temurin'
cache: maven
- name: Check formatting with Spotless
run: mvn -B -N -Dskip.spotless=false spotless:check
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,24 @@ To set up your development environment you need to:
mvn clean install -DskipTests=true
```

## Code Formatting

Run Spotless from the repository root using JDK 21 or later. CI uses JDK 25; the SDK itself still supports Java 17.

**Fix formatting errors** (updates files in place):

```bash
mvn -N -Dskip.spotless=false spotless:apply
```

**Check formatting** without changing files (the command fails if formatting errors remain):

```bash
mvn -N -Dskip.spotless=false spotless:check
```

The root configuration covers sources and POMs throughout the repository; `-N` avoids repeating the same work in each module. Released documentation snapshots are excluded.

## Contributing Guidelines

When submitting a PR, please keep the following guidelines in mind:
Expand Down
4 changes: 1 addition & 3 deletions boms/extras/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down
6 changes: 2 additions & 4 deletions boms/extras/src/it/extras-usage-test/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.a2aproject.sdk.it</groupId>
Expand Down Expand Up @@ -161,10 +159,10 @@
<executions>
<execution>
<id>verify-bom-completeness</id>
<phase>verify</phase>
<goals>
<goal>java</goal>
</goals>
<phase>verify</phase>
<configuration>
<mainClass>org.a2aproject.sdk.bom.test.extras.ExtrasBomVerifier</mainClass>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package org.a2aproject.sdk.bom.test.extras;

import org.a2aproject.sdk.bom.test.DynamicBomVerifier;

import java.util.Set;
import org.a2aproject.sdk.bom.test.DynamicBomVerifier;

/**
* Verifies Extras BOM completeness by attempting to load all discovered classes.
Expand All @@ -11,24 +10,29 @@
*/
public class ExtrasBomVerifier extends DynamicBomVerifier {

private static final Set<String> EXTRAS_EXCLUSIONS = Set.of(
"boms/", // BOM test modules themselves
"docs/", // Documentation site (not an SDK artifact)
"examples/", // Example applications
"itk/", // Integration Test Kit agent
"tck/", // TCK test suite
"tests/", // Integration tests
"test-utils-docker/", // Test utilities for Docker-based tests
"compat-0.3/", // Compat 0.3 modules (part of SDK BOM, not extras BOM)
"extras/queue-manager-replicated/tests-multi-instance/", // Test harness applications
"extras/queue-manager-replicated/tests-single-instance/", // Test harness applications
"extras/opentelemetry/integration-tests/", // Test harness applications
"extras/multitenancy/tests/" // Test support jar (uses provided junit/rest-assured deps)
);
private static final Set<String> EXTRAS_EXCLUSIONS =
Set.of(
"boms/", // BOM test modules themselves
"docs/", // Documentation site (not an SDK artifact)
"examples/", // Example applications
"itk/", // Integration Test Kit agent
"tck/", // TCK test suite
"tests/", // Integration tests
"test-utils-docker/", // Test utilities for Docker-based tests
"compat-0.3/", // Compat 0.3 modules (part of SDK BOM, not extras BOM)
"extras/queue-manager-replicated/tests-multi-instance/", // Test harness
// applications
"extras/queue-manager-replicated/tests-single-instance/", // Test harness
// applications
"extras/opentelemetry/integration-tests/", // Test harness applications
"extras/multitenancy/tests/" // Test support jar (uses provided
// junit/rest-assured deps)
);

private static final Set<String> EXTRAS_FORBIDDEN = Set.of(
"reference/" // Reference implementations (separate BOM) - must NOT be loadable
);
private static final Set<String> EXTRAS_FORBIDDEN =
Set.of(
"reference/" // Reference implementations (separate BOM) - must NOT be loadable
);

public ExtrasBomVerifier() {
super(EXTRAS_EXCLUSIONS, EXTRAS_FORBIDDEN);
Expand Down
6 changes: 2 additions & 4 deletions boms/reference/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down
6 changes: 2 additions & 4 deletions boms/reference/src/it/reference-usage-test/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.a2aproject.sdk.it</groupId>
Expand Down Expand Up @@ -150,10 +148,10 @@
<executions>
<execution>
<id>verify-bom-completeness</id>
<phase>verify</phase>
<goals>
<goal>java</goal>
</goals>
<phase>verify</phase>
<configuration>
<mainClass>org.a2aproject.sdk.bom.test.reference.ReferenceBomVerifier</mainClass>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package org.a2aproject.sdk.bom.test.reference;

import org.a2aproject.sdk.bom.test.DynamicBomVerifier;

import java.util.Set;
import org.a2aproject.sdk.bom.test.DynamicBomVerifier;

/**
* Verifies Reference BOM completeness by attempting to load all discovered classes.
Expand All @@ -11,24 +10,27 @@
*/
public class ReferenceBomVerifier extends DynamicBomVerifier {

private static final Set<String> REFERENCE_EXCLUSIONS = Set.of(
"boms/", // BOM test modules themselves
"docs/", // Documentation site (not an SDK artifact)
"examples/", // Example applications
"itk/", // Integration Test Kit agent
"tck/", // TCK test suite
"tests/", // Integration tests
"test-utils-docker/", // Test utilities for Docker-based tests
"compat-0.3/client/", // Compat 0.3 client modules (part of SDK BOM)
"compat-0.3/http-client/", // Compat 0.3 HTTP client (part of SDK BOM)
"compat-0.3/tck/", // Compat 0.3 TCK (not yet enabled)
"compat-0.3/tests/" // Compat 0.3 test utilities
// Note: reference/ and compat-0.3/reference/ are NOT excluded - we verify those classes load
);
private static final Set<String> REFERENCE_EXCLUSIONS =
Set.of(
"boms/", // BOM test modules themselves
"docs/", // Documentation site (not an SDK artifact)
"examples/", // Example applications
"itk/", // Integration Test Kit agent
"tck/", // TCK test suite
"tests/", // Integration tests
"test-utils-docker/", // Test utilities for Docker-based tests
"compat-0.3/client/", // Compat 0.3 client modules (part of SDK BOM)
"compat-0.3/http-client/", // Compat 0.3 HTTP client (part of SDK BOM)
"compat-0.3/tck/", // Compat 0.3 TCK (not yet enabled)
"compat-0.3/tests/" // Compat 0.3 test utilities
// Note: reference/ and compat-0.3/reference/ are NOT excluded - we verify those
// classes load
);

private static final Set<String> REFERENCE_FORBIDDEN = Set.of(
"extras/" // Extras modules (separate BOM) - must NOT be loadable
);
private static final Set<String> REFERENCE_FORBIDDEN =
Set.of(
"extras/" // Extras modules (separate BOM) - must NOT be loadable
);

public ReferenceBomVerifier() {
super(REFERENCE_EXCLUSIONS, REFERENCE_FORBIDDEN);
Expand Down
10 changes: 4 additions & 6 deletions boms/sdk/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down Expand Up @@ -180,16 +178,16 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>a2a-java-sdk-tests-server-common</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>a2a-java-sdk-server-common</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
<version>${project.version}</version>
</dependency>

<!-- Third-party BOMs (import scope) -->
Expand Down
6 changes: 2 additions & 4 deletions boms/sdk/src/it/sdk-usage-test/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.a2aproject.sdk.it</groupId>
Expand Down Expand Up @@ -191,10 +189,10 @@
<executions>
<execution>
<id>verify-bom-completeness</id>
<phase>verify</phase>
<goals>
<goal>java</goal>
</goals>
<phase>verify</phase>
<configuration>
<mainClass>org.a2aproject.sdk.bom.test.sdk.SdkBomVerifier</mainClass>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package org.a2aproject.sdk.bom.test.sdk;

import org.a2aproject.sdk.bom.test.DynamicBomVerifier;

import java.util.Set;
import org.a2aproject.sdk.bom.test.DynamicBomVerifier;

/**
* Verifies SDK BOM completeness by attempting to load all discovered classes.
Expand All @@ -11,23 +10,26 @@
*/
public class SdkBomVerifier extends DynamicBomVerifier {

private static final Set<String> SDK_EXCLUSIONS = Set.of(
"boms/", // BOM test modules themselves
"docs/", // Documentation site (not an SDK artifact)
"examples/", // Example applications
"itk/", // Integration Test Kit agent
"tck/", // TCK test suite
"compat-0.3/tck/", // Compat 0.3 TCK (not yet enabled)
"compat-0.3/reference/", // Compat 0.3 reference implementations (in reference BOM)
"compat-0.3/tests/", // Compat 0.3 test utilities)
"tests/", // Integration tests
"test-utils-docker/" // Test utilities for Docker-based tests
);
private static final Set<String> SDK_EXCLUSIONS =
Set.of(
"boms/", // BOM test modules themselves
"docs/", // Documentation site (not an SDK artifact)
"examples/", // Example applications
"itk/", // Integration Test Kit agent
"tck/", // TCK test suite
"compat-0.3/tck/", // Compat 0.3 TCK (not yet enabled)
"compat-0.3/reference/", // Compat 0.3 reference implementations (in reference
// BOM)
"compat-0.3/tests/", // Compat 0.3 test utilities)
"tests/", // Integration tests
"test-utils-docker/" // Test utilities for Docker-based tests
);

private static final Set<String> SDK_FORBIDDEN = Set.of(
"extras/", // Extras modules (separate BOM) - must NOT be loadable
"reference/" // Reference implementations (separate BOM) - must NOT be loadable
);
private static final Set<String> SDK_FORBIDDEN =
Set.of(
"extras/", // Extras modules (separate BOM) - must NOT be loadable
"reference/" // Reference implementations (separate BOM) - must NOT be loadable
);

public SdkBomVerifier() {
super(SDK_EXCLUSIONS, SDK_FORBIDDEN);
Expand Down
6 changes: 2 additions & 4 deletions boms/test-utils/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand All @@ -20,8 +18,8 @@
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.deploy.skip>true</maven.deploy.skip>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
Expand Down
Loading
Loading