Skip to content

Dependency Versions and Overrides

Petrus Pradella edited this page Jun 26, 2026 · 6 revisions

Dependency Versions & Overrides

What this page covers: the single source of truth for every dependency version EveryDatabase ships by default, the Java-8 floor behind those choices, and copy-paste recipes for overriding them on a newer JVM. This is the only wiki page that states version numbers — every other page links here rather than restating them.

📌 Note — these are the defaults of the everydatabase-core flavor (the recommended one). They reach your classpath as normal POM dependencies, so you override any of them with standard dependency management. everydatabase-libby downloads the same set at runtime. See Distribution Flavors.


The default set (version 1.0.4)

Dependency Default version POM scope Min Java
com.fasterxml.jackson.core:jackson-databind 2.15.4 api (compile) 8
com.fasterxml.jackson.dataformat:jackson-dataformat-yaml 2.15.4 implementation 8
org.mongodb:mongodb-driver-sync 4.11.2 api (compile) 8
com.zaxxer:HikariCP 4.0.3 implementation 8
com.h2database:h2 1.4.200 runtimeOnly 8
com.mysql:mysql-connector-j 9.4.0 runtimeOnly 8
org.postgresql:postgresql 42.7.7 runtimeOnly 8
org.slf4j:slf4j-api 1.7.36 compileOnly (optional) 8

The EveryDatabase classes themselves are compiled with --release 8, so the whole stack runs on a Java 8 JVM out of the box. slf4j-api is compileOnly by design — the library probes for SLF4J reflectively at runtime and no-ops when it's absent, so it never drags a logging framework into your build. See Logging & Diagnostics.

📌 Notemysql-connector-j excludes protobuf-java (only the removed X DevAPI referenced it). The MySQL driver is GPLv2 (+ Universal FOSS Exception); this project never bundles it — core references it as POM metadata and libby downloads it at runtime. Details on Distribution Flavors.


Why these versions (the Java-8 floor)

Two of the defaults are deliberately pinned to the last Java-8-compatible line of their library — the majors after them are Java 11 bytecode:

  • HikariCP 4.0.35.x is compiled for Java 11.
  • H2 1.4.2002.x is compiled for Java 11.

Pinning them is what lets every backend run on a Java 8 runtime. On Java 11+ you can move to the newer majors (recipes below). Everything else (Jackson 2.15.4, the Mongo driver, both JDBC drivers) is already Java-8-clean at the listed version.

⚠️ Gotcha — H2 1.x ↔ 2.x are not interchangeable on disk. The two majors use incompatible database file formats and slightly different SQL dialects. Never swap the H2 major version over an existing embedded-file database — export and re-import instead. In-memory H2 (jdbc:h2:mem:) has no such concern. See H2.


Overriding a version (the core flavor)

Declare your own version; Gradle picks the highest by default, and your nearest declaration wins in Maven. Append !! (Gradle) to force a downgrade.

Upgrade Jackson

implementation 'br.com.finalcraft.everydatabase:everydatabase-core:1.0.4'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.2'   // also pull yaml to match
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.17.2'

HikariCP 5.x and H2 2.x on Java 11+

implementation 'com.zaxxer:HikariCP:5.1.0'     // Java 11+ (5.x line)
implementation 'com.h2database:h2:2.3.232'     // Java 11+ (2.x line) — read the H2 warning above!

Force-downgrade a driver

runtimeOnly 'com.mysql:mysql-connector-j:8.4.0!!'   // '!!' forces this exact version in Gradle
<!-- Maven: your nearest declaration always wins -->
<dependency>
  <groupId>com.mysql</groupId>
  <artifactId>mysql-connector-j</artifactId>
  <version>8.4.0</version>
</dependency>

Dropping what you don't use

Only target SQL? Exclude the Mongo driver entirely:

implementation('br.com.finalcraft.everydatabase:everydatabase-core:1.0.4') {
    exclude group: 'org.mongodb'
}

The same exclude pattern drops any backend driver you'll never touch.


Maven repository

All flavors are published to a public Maven repository:

repositories {
    maven { url 'https://maven.petrus.dev/public' }
    mavenCentral()
}
<repository>
  <id>petrus-public</id>
  <url>https://maven.petrus.dev/public</url>
</repository>

The everydatabase-libby flavor additionally needs https://repo.alessiodp.com/releases/ (for net.byteflux:libby-core). See Installation and Distribution Flavors.


Build-time JDK (contributors only)

This is about building the library, not consuming it — consumers only need a Java 8+ runtime.

  • Launch Gradle with JDK 25. The wrapper is Gradle 9.5.1, which runs on a JDK 25 launcher directly. Test code compiles and runs on the Java 25 toolchain.
  • Production code targets Java 8. compileJava is pinned to a Java 17 compiler with options.release = 8; the Jabel annotation processor lets Java 17 syntax emit Java 8 bytecode.

See Building from Source.


See also

Clone this wiki locally