Exposed is split into specific modules that give you the flexibility to only use the modules you need. In this topic you'll learn what these modules are and how to add module dependencies to an existing Gradle/Maven project.
Configure the repository
Exposed modules are available from the Maven Central repository. To use them, add the appropriate dependency into your repository mapping:
repositories {
mavenCentral()
}
The Maven Central repository is enabled by default for Maven users.
repositories {
mavenCentral()
}
Add dependencies
At a minimum, an Exposed application requires the core module and exactly one transport module. The examples below show the smallest possible dependency sets for common setups:
If you use a Gradle version catalog, you can import the published exposed-version-catalog instead of listing each Exposed coordinate by hand. The catalog provides a type-safe accessor for every Exposed module and keeps their versions aligned.
The accessor for each module is its name with the exposed- prefix removed and any dashes turned into nested accessors. For example, exposed-kotlin-datetime becomes exposedLibs.kotlin.datetime.
All modules share the same exposed version, which you can override for the whole catalog in one place:
To use Exposed in your application, you need the following core module:
Module
Function
exposed-core
Provides the foundational components and abstractions needed to work with databases in a type-safe manner and includes the Domain-Specific Language (DSL) API
Transport modules
Transport modules define how Exposed communicates with the database and are mutually exclusive.
Module
Function
exposed-jdbc
Provides support for Java Database Connectivity (JDBC) with a transport-level implementation based on the Java JDBC API
exposed-r2dbc
Provides support for Reactive Relational Database Connectivity (R2DBC)
Database access modules
Exposed offers optional database access modules that build on top of exposed-core and provide higher-level abstractions for working with database data. Pick the one matching your transport module:
Module
Function
exposed-dao
Provides the Data Access Object (DAO) API. Requires exposed-jdbc and is not compatible with exposed-r2dbc.
exposed-dao-r2dbc
Provides the DAO API for R2DBC. Requires exposed-r2dbc, and is an experimental preview whose API may still change between releases.
Extension modules
The following modules extend Exposed's capabilities, allowing you to work with specific data types, encryption, and date-time handling:
Module
Function
exposed-crypt
Provides additional column types to store encrypted data in the database and encode/decode it on the client-side, as well as one-way hashed data such as passwords
A starter for Spring Boot 3 to utilize Exposed as the ORM
exposed-spring-boot4-starter
A starter for Spring Boot 4 to utilize Exposed as the ORM
spring-transaction
Transaction manager that builds on top of the standard transaction workflow from Spring Framework 6
spring7-transaction
Transaction manager that builds on top of the standard transaction workflow from Spring Framework 7
exposed-migration-core
Provides core common functionality for database schema migrations
exposed-migration-jdbc
Provides utilities to support database schema migrations, with a reliance on a JDBC driver
exposed-migration-r2dbc
Provides utilities to support database schema migrations, with a reliance on a R2DBC driver
Add a JDBC/R2DBC driver
You also need a JDBC or R2DBC driver for the database system you are using. For example, the following dependency adds a JDBC driver for the H2 database: