-
Notifications
You must be signed in to change notification settings - Fork 77
Added Maven project example + Maven setup instructions #1643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
a6b00a9
d85b54c
00262ee
c907e1c
b953e5a
c21889c
b0c78c1
cfd05a1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,123 @@ | ||
| # Setup Kotlin DataFrame in Maven | ||
|
|
||
| <web-summary> | ||
| Set up Kotlin DataFrame in your Maven project, configure dependencies, and start using the API with full IDE support. | ||
| </web-summary> | ||
|
|
||
| <card-summary> | ||
| Learn how to add Kotlin DataFrame to your Maven project. | ||
| </card-summary> | ||
|
|
||
| <link-summary> | ||
| Guide for integrating Kotlin DataFrame in a Maven project, with setup instructions and example code. | ||
| </link-summary> | ||
|
|
||
| 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](https://www.oracle.com/java/technologies/downloads/) | ||
| that you want to use in your project. The minimum supported version is JDK 8. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe we should recommend newer versions as well, as some parts of DF require 11 |
||
| * 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: | ||
|
|
||
| ```xml | ||
| <dependency> | ||
| <groupId>org.jetbrains.kotlinx</groupId> | ||
| <artifactId>dataframe</artifactId> | ||
| <version>%dataFrameVersion%</version> | ||
| </dependency> | ||
| ``` | ||
|
|
||
| This will add [general Kotlin DataFrame dependency](Modules.md#dataframe-general), | ||
| i.e., [core API and implementation](Modules.md#dataframe-core) as well as all | ||
| [IO modules](Modules.md#io-modules) (excluding [experimental ones](Modules.md#experimental-modules)). | ||
| You can add only the [core API module](Modules.md#dataframe-core) | ||
| and the specific [modules](Modules.md) you need. | ||
|
|
||
|
|
||
| ## Hello World | ||
|
|
||
| Let’s create your first [`DataFrame`](DataFrame.md) — a simple "Hello, World!" style example: | ||
|
|
||
| ```kotlin | ||
| 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](Compiler-Plugin.md) enables automatic generation of | ||
| [extension properties](extensionPropertiesApi.md) and updates [data schemas](schemas.md) | ||
| 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. | ||
|
||
| > { style = "note" } | ||
| To enable the plugin in your Maven project, add it to the `plugins` section: | ||
|
|
||
| ```xml | ||
| <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](https://github.com/Kotlin/dataframe/tree/master/examples/kotlin-dataframe-plugin-maven-example). | ||
|
|
||
|
|
||
| ## Next Steps | ||
|
|
||
| * Once you’ve set up Kotlin DataFrame in your Maven project, continue with the [](quickstart.md) | ||
| to learn the basics of working with Kotlin DataFrame. | ||
| * Explore [detailed guides and real-world examples](Guides-And-Examples.md) | ||
| to see how Kotlin DataFrame helps with different data tasks. | ||
| * Check out various | ||
| [IDEA examples using Kotlin DataFrame on GitHub](https://github.com/Kotlin/dataframe/tree/master/examples/idea-examples). | ||
| * Learn more about the [compiler plugin](Compiler-Plugin.md). | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,5 +2,5 @@ | |
| <!DOCTYPE vars SYSTEM "https://resources.jetbrains.com/writerside/1.0/vars.dtd"> | ||
| <vars> | ||
| <var name="dataFrameVersion" value="1.0.0-Beta4" type="string"/> | ||
| <var name="compilerPluginKotlinVersion" value="2.3.0-RC" type="string"/> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2.3.0 is released |
||
| <var name="compilerPluginKotlinVersion" value="2.3.0-RC3" type="string"/> | ||
| </vars> | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # Kotlin DataFrame Compiler Gradle Plugin Example | ||
|
|
||
| An IntelliJ IDEA Gradle Kotlin project demonstrating the use of the | ||
| [Kotlin DataFrame Compiler Plugin](https://kotlin.github.io/dataframe/compiler-plugin.html). | ||
|
|
||
| We recommend using an up-to-date IntelliJ IDEA for the best experience, | ||
| as well as the latest Kotlin plugin version. | ||
|
|
||
| > [!WARNING] | ||
| > For proper functionality in IntelliJ IDEA requires version 2025.2 or newer. | ||
|
|
||
| [Download Kotlin DataFrame Compiler Plugin Gradle Example](https://github.com/Kotlin/dataframe/raw/example-projects-archives/kotlin-dataframe-plugin-gradle-example.zip) | ||
|
|
||
| See also [Kotlin DataFrame Compiler Maven Plugin Example](../kotlin-dataframe-plugin-maven-example) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| target/ | ||
| !.mvn/wrapper/maven-wrapper.jar | ||
| !**/src/main/**/target/ | ||
| !**/src/test/**/target/ | ||
| .kotlin | ||
|
|
||
| ### IntelliJ IDEA ### | ||
| .idea/modules.xml | ||
| .idea/jarRepositories.xml | ||
| .idea/compiler.xml | ||
| .idea/libraries/ | ||
| *.iws | ||
| *.iml | ||
| *.ipr | ||
|
|
||
| ### Eclipse ### | ||
| .apt_generated | ||
| .classpath | ||
| .factorypath | ||
| .project | ||
| .settings | ||
| .springBeans | ||
| .sts4-cache | ||
|
|
||
| ### NetBeans ### | ||
| /nbproject/private/ | ||
| /nbbuild/ | ||
| /dist/ | ||
| /nbdist/ | ||
| /.nb-gradle/ | ||
| build/ | ||
| !**/src/main/**/build/ | ||
| !**/src/test/**/build/ | ||
|
|
||
| ### VS Code ### | ||
| .vscode/ | ||
|
|
||
| ### Mac OS ### | ||
| .DS_Store |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@koperagen this isn't a problem in Maven?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a problem there