-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a6b00a9
add maven project example
AndreiKingsley d85b54c
update readmes and Kotlin versions
AndreiKingsley 00262ee
update readme of examples
AndreiKingsley c907e1c
update example project links in readmes and archives
AndreiKingsley b953e5a
add SetupMaven
AndreiKingsley c21889c
add SetupMaven to Setup.md
AndreiKingsley b0c78c1
fix maven project archive
AndreiKingsley cfd05a1
add Maven to readme and improve SetupMaven.md
AndreiKingsley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| # 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 and IntelliJ IDEA 2025.3 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). | ||
|
|
||
| You can also | ||
| [download this project](https://github.com/Kotlin/dataframe/raw/example-projects-archives/kotlin-dataframe-plugin-maven-example.zip). | ||
|
|
||
|
|
||
| ## 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). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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