Exposed 0.61.0 Help

Modules

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 repositories mapping:

repositories { mavenCentral() }

The Maven Central repository is enabled by default for Maven users.

repositories { mavenCentral() }

Add Exposed dependencies

Exposed consists of multiple modules that we've split into two categories:

Core modules

To use Exposed in your application you need the following core modules:

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

exposed-dao

(Optional) Allows you to work with the Data Access Object (DAO) API

exposed-jdbc

Provides support for Java Database Connectivity (JDBC) with a transport-level implementation based on the Java JDBC API

Add the required Exposed modules to your project's dependencies:

dependencies { implementation("org.jetbrains.exposed:exposed-core:0.61.0") implementation("org.jetbrains.exposed:exposed-jdbc:0.61.0") implementation("org.jetbrains.exposed:exposed-dao:0.61.0") // Optional }
<dependencies> <dependency> <groupId>org.jetbrains.exposed</groupId> <artifactId>exposed-core</artifactId> <version>0.61.0</version> </dependency> <dependency> <groupId>org.jetbrains.exposed</groupId> <artifactId>exposed-jdbc</artifactId> <version>0.61.0</version> </dependency> <dependency> <groupId>org.jetbrains.exposed</groupId> <artifactId>exposed-dao</artifactId> <version>0.61.0</version> </dependency> </dependencies>
dependencies { implementation "org.jetbrains.exposed:exposed-core:0.61.0" implementation "org.jetbrains.exposed:exposed-jdbc:0.61.0" implementation "org.jetbrains.exposed:exposed-dao:0.61.0" //optional }

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

exposed-java-time

Date-time extensions based on the Java 8 Time API

exposed-jodatime

Date-time extensions based on the Joda-Time library

exposed-json

JSON and JSONB data type extensions

exposed-kotlin-datetime

Date-time extensions based on the kotlinx-datetime library

exposed-money

Extensions to support MonetaryAmount from the JavaMoney API

exposed-spring-boot-starter

A starter for Spring Boot to utilize Exposed as the ORM instead of Hibernate

spring-transaction

Transaction manager that builds on top of Spring's standard transaction workflow

exposed-migration

Provides utilities to support database schema migrations

Add a JDBC driver

You also need a JDBC driver for the database system you are using. For example, the following dependency adds a JDBC driver for the H2 database:

dependencies { implementation("com.h2database:h2:2.2.224") }
<dependencies> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <version>2.2.224</version> </dependency> </dependencies>
dependencies { implementation "com.h2database:h2:2.2.224" }

Add a logging dependency

To be able to see logs from StdOutSqlLogger, add a logging dependency:

dependencies { implementation("org.slf4j:slf4j-nop:1.7.30") }
<dependencies> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-nop</artifactId> <version>1.7.30</version> </dependency> </dependencies>
dependencies { implementation "org.slf4j:slf4j-nop:1.7.30" }
Last modified: 09 May 2025