Files
2026-02-08 11:20:43 -10:00

4.5 KiB
Vendored
Raw Permalink Blame History

Setup Kotlin DataFrame in Maven

Set up Kotlin DataFrame in your Maven project, configure dependencies, and start using the API with full IDE support. Learn how to add Kotlin DataFrame to your Maven project. Guide for integrating Kotlin DataFrame in a Maven project, with setup instructions and example code.

Kotlin DataFrame can be added as a usual Maven dependency to your Kotlin project.

Create a Kotlin project

  1. In IntelliJ IDEA, select File | New | Project.

  2. In the panel on the left, select New Project.

  3. Name the new project and change its location, if necessary.

    Select the Create Git repository checkbox to place the new project under version control. You can enable this later at any time. {type="tip"}

  4. From the Language list, select Kotlin.

  5. Select the Maven build system.

  6. From the JDK list, select the JDK that you want to use in your project. The minimum supported version is JDK 8.

    • If the JDK is installed on your computer, but not defined in the IDE, select Add JDK and specify the path to the JDK home directory.
    • If you don't have the necessary JDK on your computer, select Download JDK.
  7. Select the Add sample code checkbox to create a file with a sample "Hello World!" application.

  8. Click Create.

You have successfully created a project with Maven.

Add Kotlin DataFrame Maven dependency

In your Maven build file (pom.xml), add the Kotlin DataFrame library as a dependency:

<dependency>
    <groupId>org.jetbrains.kotlinx</groupId>
    <artifactId>dataframe</artifactId>
    <version>%dataFrameVersion%</version>
</dependency>

This will add general Kotlin DataFrame dependency, i.e., core API and implementation as well as all IO modules (excluding experimental ones).
You can add only the core API module and the specific modules you need.

Hello World

Lets create your first DataFrame — a simple "Hello, World!" style example:

import org.jetbrains.kotlinx.dataframe.api.dataFrameOf
import org.jetbrains.kotlinx.dataframe.api.print

fun main() {
    val df = dataFrameOf(
        "name" to listOf("Alice", "Bob"),
        "age" to listOf(25, 30)
    )

    df.print()
}

Kotlin DataFrame Compiler Plugin

Kotlin DataFrame Compiler Plugin enables automatic generation of extension properties and updates data schemas on-the-fly in Maven projects, making development with Kotlin DataFrame faster, more convenient, and fully type- and name-safe.

Requires Kotlin 2.2.20-Beta1 or higher and IntelliJ IDEA 2025.3 or higher.
{ style = "note" }

To enable the plugin in your Maven project, add it to the plugins section:

<plugin>
    <artifactId>kotlin-maven-plugin</artifactId>
    <groupId>org.jetbrains.kotlin</groupId>
    <version>%compilerPluginKotlinVersion%</version>

    <configuration>
        <compilerPlugins>
            <plugin>kotlin-dataframe</plugin>
        </compilerPlugins>
    </configuration>

    <dependencies>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-maven-dataframe</artifactId>
            <version>%compilerPluginKotlinVersion%</version>
        </dependency>
    </dependencies>
</plugin>

Project Example

See the Maven example project with the Kotlin DataFrame Compiler Plugin enabled on GitHub.

You can also download this project.

Next Steps