exposed-version-catalog/README.md
A Gradle version catalog for all published Exposed modules. It lets you reference Exposed dependencies through type-safe accessors instead of hard-coding coordinates and versions.
Import the catalog in your settings.gradle.kts:
dependencyResolutionManagement {
repositories {
mavenCentral()
}
versionCatalogs {
create("exposedLibs") {
from("org.jetbrains.exposed:exposed-version-catalog:1.5.0")
}
}
}
Then reference modules in your build.gradle.kts:
dependencies {
implementation(exposedLibs.core)
implementation(exposedLibs.jdbc)
implementation(exposedLibs.kotlin.datetime)
}
The accessor for each module is its module name with the exposed- prefix removed and dashes turned
into nested accessors, for example:
| Module | Accessor |
|---|---|
exposed-core | exposedLibs.core |
exposed-jdbc | exposedLibs.jdbc |
exposed-r2dbc | exposedLibs.r2dbc |
exposed-kotlin-datetime | exposedLibs.kotlin.datetime |
spring7-transaction | exposedLibs.spring7.transaction |
All libraries share the exposed version, so you can override the whole Exposed version in one place:
versionCatalogs {
create("exposedLibs") {
from("org.jetbrains.exposed:exposed-version-catalog:1.5.0")
version("exposed", "1.5.0")
}
}
Why
exposedLibsand notexposed? The Exposed Gradle plugin registers a project extension namedexposed(theexposed { migrations { } }DSL). A version catalog is also exposed as a project extension named after the catalog, so naming this catalogexposedwould clash with the plugin (Cannot add extension with name 'exposed'). Naming itexposedLibskeeps both usable in the same project. If you don't apply the Exposed Gradle plugin, you're free to name the catalogexposed.