You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/topics/jvm/jvm-create-project-with-spring-boot.md
+21-18Lines changed: 21 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,27 +6,28 @@
6
6
<p><img src="icon-1.svg" width="20" alt="First step"/> <strong>Create a Spring Boot project with Kotlin</strong><br/><img src="icon-2-todo.svg" width="20" alt="Second step"/> Add a data class to the Spring Boot project<br/><img src="icon-3-todo.svg" width="20" alt="Third step"/> Add database support for the Spring Boot project<br/><img src="icon-4-todo.svg" width="20" alt="Fourth step"/> Use Spring Data CrudRepository for database access<br/></p>
7
7
</tldr>
8
8
9
-
The first part of the tutorial shows you how to create a Spring Boot project in IntelliJ IDEA using Project Wizard.
9
+
The first part of the tutorial shows how to create a Spring Boot project with Gradle in IntelliJ IDEA using the Project Wizard.
10
+
11
+
> This tutorial doesn't require using Gradle as the build system. You can follow the same steps if you use Maven.
12
+
>
13
+
{style="note"}
10
14
11
15
## Before you start
12
16
13
17
Download and install the latest version of [IntelliJ IDEA Ultimate Edition](https://www.jetbrains.com/idea/download/index.html).
14
18
15
-
> If you use IntelliJ IDEA Community Edition or another IDE, you can generate a Spring Boot project using a [web-based project generator](https://start.spring.io).
19
+
> If you use IntelliJ IDEA Community Edition or another IDE, you can generate a Spring Boot project using
20
+
> a [web-based project generator](https://start.spring.io/#!language=kotlin&type=gradle-project-kotlin).
16
21
>
17
-
{style="note"}
22
+
{style="tip"}
18
23
19
24
## Create a Spring Boot project
20
25
21
26
Create a new Spring Boot project with Kotlin by using the Project Wizard in IntelliJ IDEA Ultimate Edition:
22
27
23
-
> You can also create a new project using [IntelliJ IDEA with the Spring Boot plugin](https://www.jetbrains.com/help/idea/spring-boot.html).
24
-
>
25
-
{style="note"}
26
-
27
28
1. In IntelliJ IDEA, select **File** | **New** | **Project**.
28
29
2. In the panel on the left, select **New Project** | **Spring Boot**.
29
-
3. Specify the following fields and options in the Project Wizard window:
30
+
3. Specify the following fields and options in the **New Project** window:
30
31
31
32
***Name**: demo
32
33
***Language**: Kotlin
@@ -36,10 +37,10 @@ Create a new Spring Boot project with Kotlin by using the Project Wizard in Inte
36
37
>
37
38
{style="tip"}
38
39
39
-
***Package name**: demo
40
+
***Package name**: com.example.demo
40
41
***JDK**: Java JDK
41
42
42
-
> This tutorial uses **Amazon Corretto version 21**.
43
+
> This tutorial uses **Amazon Corretto version 23**.
43
44
> If you don't have a JDK installed, you can download it from the dropdown list.
44
45
>
45
46
{style="note"}
@@ -83,10 +84,10 @@ Here is the full script with the explanation of all parts and dependencies:
83
84
```kotlin
84
85
// build.gradle.kts
85
86
plugins {
86
-
kotlin("jvm") version "1.9.24"// The version of Kotlin to use
87
-
kotlin("plugin.spring") version "1.9.24"// The Kotlin Spring plugin
88
-
id("org.springframework.boot") version "3.3.4"
89
-
id("io.spring.dependency-management") version "1.1.6"
87
+
kotlin("jvm") version "%springBootSupportedKotlinVersion%"// The version of Kotlin to use
88
+
kotlin("plugin.spring") version "%springBootSupportedKotlinVersion%"// The Kotlin Spring plugin
89
+
id("org.springframework.boot") version "%springBootVersion%"
90
+
id("io.spring.dependency-management") version "1.1.7"
90
91
}
91
92
92
93
group ="com.example"
@@ -139,13 +140,15 @@ As you can see, there are a few Kotlin-related artifacts added to the Gradle bui
139
140
3. After the dependencies section, you can see the `kotlin` plugin configuration block.
140
141
This is where you can add extra arguments to the compiler to enable or disable various language features.
141
142
143
+
Learn more about the Kotlin compiler options in [](gradle-compiler-options.md).
0 commit comments