Adding dependencies
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:
The Maven Central repository is enabled by default for Maven users.
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:
Modules
Exposed consists of multiple modules, grouped into the following categories:
Core module
To use Exposed in your application, you need the following core module:
Module | Function |
|---|---|
| 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 |
|---|---|
| Provides support for Java Database Connectivity (JDBC) with a transport-level implementation based on the Java JDBC API |
| Provides support for Reactive Relational Database Connectivity (R2DBC) |
Database access module
Exposed offers an optional database access module that builds on top of exposed-core and provides higher-level abstractions for working with database data:
Module | Function |
|---|---|
| Provides the Data Access Object (DAO) API. |
Extension modules
The following modules extend Exposed's capabilities, allowing you to work with specific data types, encryption, and date-time handling:
Module | Function |
|---|---|
| Provides additional column types to store encrypted data in the database and encode/decode it on the client-side |
| Date-time extensions based on the Java 8 Time API |
| Date-time extensions based on the Joda-Time library |
| JSON and JSONB data type extensions |
| Date-time extensions based on the |
| Extensions to support |
| A starter for Spring Boot 3 to utilize Exposed as the ORM |
| A starter for Spring Boot 4 to utilize Exposed as the ORM |
| Transaction manager that builds on top of the standard transaction workflow from Spring Framework 6 |
| Transaction manager that builds on top of the standard transaction workflow from Spring Framework 7 |
| Provides core common functionality for database schema migrations |
| Provides utilities to support database schema migrations, with a reliance on a JDBC driver |
| 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:
Add a logging dependency
To be able to see logs from StdOutSqlLogger, add a logging dependency: