Instructions for AI coding agents working in this repository.
Checkout relevant .agents/skills/ to accomplish specific tasks.
mvn test-compile # compile code and tests
mvn test # run all tests (requires Docker for database interactions)
mvn spotless:check # verify formatting
mvn spotless:apply # auto-fix formattingThis is a multi-module Maven project with the following key modules:
- vertx-sql-client: Core SQL client API and base implementations
- vertx-sql-client-codec: Shared codec utilities for data type encoding/decoding
- vertx-sql-client-templates: SQL template support for type-safe queries
- vertx-pg-client: PostgreSQL-specific client implementation
- vertx-mysql-client: MySQL/MariaDB-specific client implementation
- vertx-mssql-client: Microsoft SQL Server client implementation
- vertx-db2-client: IBM DB2 client implementation
- vertx-oracle-client: Oracle Database client implementation
Each database-specific client follows this structure:
src/main/java/: Public API interfaces and implementation classes- Top package (e.g.,
io.vertx.pgclient): Public API interfaces impl/subpackage: Implementation classes (not exported)
- Top package (e.g.,
src/main/asciidoc/: Module-specific documentationsrc/test/java/: Unit and integration testsmodule-info.java: Defines module exports and dependencies
These rules apply when writing or modifying code. Code review is the checkpoint where compliance is verified.
In production code, use the Vert.x internal logger, never SLF4J, Log4j, or java.util.logging directly.
import io.vertx.core.internal.logging.Logger;
import io.vertx.core.internal.logging.LoggerFactory;
private static final Logger logger = LoggerFactory.getLogger(MyClass.class);Vert.x internal logging API doesn't support parameters placeholders. Check the active level before debug or trace logging.
if (logger.isDebugEnabled()) {
logger.debug("Prepared parameters: " + paramDesc);
}Use Vert.x Future<T> and Promise<T> throughout. Do not use raw callbacks or CompletableFuture in production code.
- Public contracts are interfaces in the top package (
io.vertx.sqlclient,io.vertx.pgclient, …) - Implementations go in
impl/subpackages - Annotate public API interfaces and methods with
@VertxGenfor code-generation support - Expose construction via static factory methods, not constructors
module-info.java governs exports.
Internal packages are exported only to their corresponding test modules, do not widen exports without discussion.
Test module descriptors (src/test/java/module-info.java) can be modified freely, e.g. to add a requires for a new dependency used in tests.
New Java files must include the dual-license header matching existing files:
/*
* Copyright (c) 2011-2026 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
* which is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
*/The range is always 2011-[current year].
For comprehensive testing patterns and examples, see .agents/skills/writing-tests/SKILL.md.
- Use JUnit 4 (version 4.13.1) for all tests
- Async tests use VertxUnitRunner (JUnit 4 runner) and TestContext
- Integration tests require Docker for database containers
@RunWith(VertxUnitRunner.class)
public class MyTest {
@Test
public void testAsyncOperation(TestContext ctx) {
Async async = ctx.async();
client.query("SELECT 1")
.execute()
.onComplete(ctx.asyncAssertSuccess(result -> {
ctx.assertEquals(1, result.size());
async.complete();
}));
}
}- Unit tests: Same module as code under test, in
src/test/java/ - Integration tests: May be in separate test modules or
src/test/java/ - Database-specific tests: In respective client module (e.g.,
vertx-pg-client/src/test/)
mvn test # Run all tests (requires Docker)
mvn test -Dtest=MyTest # Run specific test class
mvn test -Dtest=MyTest#testMethod # Run specific test method
# When your change spans modules (e.g. modifying vertx-sql-client-codec and
# testing in vertx-pg-client), use -am to rebuild dependencies:
mvn test -pl vertx-pg-client -am -Dtest=MyTest- All new features must include tests
- Database tests must clean up resources (connections, containers)
When making changes:
- Compile frequently:
mvn compile -pl <module> - Run affected tests:
mvn test -pl <module> - Verify formatting:
mvn spotless:check - Run full build before PR:
mvn clean install
# Skip tests during development
mvn compile -DskipTests
# Build specific module and dependencies
mvn install -pl vertx-pg-client -amWhen performing specific tasks, read the relevant skill file for detailed guidance:
- Writing tests - Read
.agents/skills/writing-tests/SKILL.mdwhen creating or modifying tests
- All commits must be signed off:
git commit -s(DCO) - Commit messages should end with:
Assisted-by: [Provider] [Model-Family] ([Version/ID])(replace placeholders) - Contributors must have signed the Eclipse Contributor Agreement (ECA)
See CONTRIBUTING.md for the full contribution workflow.
- General coding rules above are followed
- Test coverage is present; async tests use
VertxUnitRunnerandTestContext - No breaking changes to public interfaces without prior discussion
- Patterns already used consistently throughout the codebase