Skip to content

Commit 2dfa6cf

Browse files
committed
Enhance test, and remove noise from README
1 parent 92a0cb7 commit 2dfa6cf

File tree

2 files changed

+27
-59
lines changed

2 files changed

+27
-59
lines changed

boms/README.md

Lines changed: 3 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,8 @@ Add to your project's `pom.xml`:
140140

141141
## Internal Project Usage
142142

143-
**Important:** The A2A Java SDK project itself does **NOT** import these BOMs in the parent `pom.xml`.
144-
145-
### Why Not Use BOMs Internally?
146-
147-
Following the WildFly pattern, we keep BOMs separate from internal dependency management for several reasons:
148-
149-
1. **Build Order Complexity**: BOMs must be built before other modules, adding reactor ordering constraints
150-
2. **Flexibility**: Parent pom may need different scopes/configurations than external users
151-
3. **Simplicity**: Avoids potential circular dependencies and build complexity
152-
4. **Single Source of Truth**: Parent `pom.xml` remains authoritative for internal builds
143+
**Important:** The A2A Java SDK project itself does **NOT** import these BOMs in the parent `pom.xml`. The BOMs are
144+
for the convenience of external users.
153145

154146
### Maintenance Strategy
155147

@@ -235,44 +227,4 @@ The BOMs use `${project.version}` for all A2A SDK modules, ensuring:
235227
- Version updates only need to change parent pom
236228
- No version drift between BOMs and SDK modules
237229

238-
## Build Order
239-
240-
BOMs have explicit dependencies to ensure correct reactor build order:
241-
- **SDK BOM** builds first (no BOM dependencies)
242-
- **Extras BOM** builds second (depends on SDK BOM)
243-
- **Reference BOM** builds third (depends on SDK BOM)
244-
245-
Maven's reactor automatically orders them correctly based on their `<dependencies>` declarations, regardless of their position in the parent pom's `<modules>` section.
246-
247-
## Examples
248-
249-
See the `examples/` directory for sample projects using these BOMs:
250-
- `examples/helloworld/` - Basic agent using SDK BOM
251-
- `examples/cloud-deployment/` - Quarkus-based agent using Reference BOM
252-
253-
## Release Process
254-
255-
When releasing the A2A Java SDK:
256-
257-
1. All three BOMs are released as separate Maven artifacts
258-
2. External users can depend on them via Maven Central
259-
3. BOMs follow the same version scheme as the SDK (e.g., `0.4.0.Alpha1`, `0.4.0`)
260-
261-
## Questions?
262-
263-
- **Which BOM should I use?**
264-
- Quarkus project → Reference BOM
265-
- Production server with database/distributed features → Extras BOM
266-
- Other framework/basic agent → SDK BOM
267-
268-
- **Can I use Extras BOM with Spring Boot?**
269-
- Yes! Extras BOM imports SDK BOM and adds server enhancements that work with any framework.
270-
271-
- **Can I use Reference BOM with Spring Boot?**
272-
- Yes, but you'll get unnecessary Quarkus dependencies. Use SDK BOM or Extras BOM instead.
273-
274-
- **Do I need multiple BOMs?**
275-
- No, choose one. Extras BOM imports SDK BOM. Reference BOM imports SDK BOM.
276-
277-
- **Why are test dependencies in SDK BOM?**
278-
- Test scope dependencies don't pollute runtime, but allow users to easily import test utilities.
230+
Maven's reactor automatically orders them correctly based on their `<dependencies>` declarations, regardless of their position in the parent pom's `<modules>` section.

boms/test-utils/src/main/java/io/a2a/bom/test/DynamicBomVerifier.java

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,11 @@ public void verify() throws Exception {
4343
Set<String> requiredClasses = discoverRequiredClasses(projectRoot);
4444
Set<String> forbiddenClasses = discoverForbiddenClasses(projectRoot);
4545

46-
// Do some sanity checks for some classes from both top-level and nested modules to make sure the
47-
// discovery mechanism worked properly
48-
sanityCheckDisovery("io.a2a.spec.AgentCard", requiredClasses);
49-
sanityCheckDisovery("io.a2a.server.events.EventConsumer", requiredClasses);
50-
sanityCheckDisovery("io.a2a.client.transport.spi.ClientTransport", requiredClasses);
51-
5246
System.out.println("Discovered " + requiredClasses.size() + " required classes to verify");
5347
System.out.println("Discovered " + forbiddenClasses.size() + " forbidden classes to verify");
5448

49+
sanityCheckDiscovery(requiredClasses, forbiddenClasses);
50+
5551
List<String> failures = new ArrayList<>();
5652
int successful = 0;
5753

@@ -98,8 +94,28 @@ public void verify() throws Exception {
9894
System.out.println("\n✅ BOM is COMPLETE - all required classes loaded, all forbidden classes not loadable!");
9995
}
10096

101-
private void sanityCheckDisovery(String className, Set<String> discovered) {
102-
if (!discovered.contains(className)) {
97+
private void sanityCheckDiscovery(Set<String> requiredClasses, Set<String> forbiddenClasses) {
98+
// Do some sanity checks for some classes from both top-level and nested modules to make sure the
99+
// discovery mechanism worked properly
100+
sanityCheckDisovery("io.a2a.spec.AgentCard", requiredClasses, forbiddenClasses);
101+
sanityCheckDisovery("io.a2a.server.events.EventConsumer", requiredClasses, forbiddenClasses);
102+
sanityCheckDisovery("io.a2a.client.transport.spi.ClientTransport", requiredClasses, forbiddenClasses);
103+
104+
sanityCheckDisovery("io.a2a.server.common.quarkus.DefaultProducers", requiredClasses, forbiddenClasses);
105+
sanityCheckDisovery("io.a2a.extras.common.events.TaskFinalizedEvent", requiredClasses, forbiddenClasses);
106+
sanityCheckDisovery("io.a2a.extras.queuemanager.replicated.core.ReplicatedEventQueueItem", requiredClasses, forbiddenClasses);
107+
108+
// Make sure that the required and forbidden sets don't contain the same classes
109+
Set<String> intersection = new HashSet<>(requiredClasses);
110+
intersection.retainAll(forbiddenClasses);
111+
if (!intersection.isEmpty()) {
112+
System.err.println("The following classes appear in both the required and forbidden sets: " + intersection);
113+
System.exit(1);
114+
}
115+
}
116+
117+
private void sanityCheckDisovery(String className, Set<String> requiredClasses, Set<String> forbiddenClasses) {
118+
if (!requiredClasses.contains(className) && !forbiddenClasses.contains(className)) {
103119
System.err.println("Class expected to be on the classpath was not discovered: " + className);
104120
System.exit(1);
105121
}

0 commit comments

Comments
 (0)