Skip to content

Commit fd5e036

Browse files
JAVA-25239 | spring-boot 2 -> spring-boot 3! (#631)
* JAVA-25239 | spring-boot 2 -> spring-boot 3! * java-25239 | fixed test and log4j dependency-
1 parent 7068f05 commit fd5e036

File tree

17 files changed

+143
-54
lines changed

17 files changed

+143
-54
lines changed

parent-boot-2/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project
3-
xmlns="http://maven.apache.org/POM/4.0.0"
4-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xmlns="http://maven.apache.org/POM/4.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
66
<modelVersion>4.0.0</modelVersion>
77
<artifactId>parent-boot-2</artifactId>
88
<version>1.0.0-SNAPSHOT</version>

parent-boot-3/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Parent Boot 3
2+
3+
This is a parent module for all projects using Spring Boot 3.

parent-boot-3/pom.xml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project
3+
xmlns="http://maven.apache.org/POM/4.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
6+
<modelVersion>4.0.0</modelVersion>
7+
<artifactId>parent-boot-3</artifactId>
8+
<version>1.0.0-SNAPSHOT</version>
9+
<name>parent-boot-3</name>
10+
<packaging>pom</packaging>
11+
<description>Parent for all Spring Boot 3 modules</description>
12+
13+
<parent>
14+
<groupId>com.baeldung</groupId>
15+
<artifactId>kotlin-modules</artifactId>
16+
<version>1.0.0-SNAPSHOT</version>
17+
</parent>
18+
19+
<dependencyManagement>
20+
<dependencies>
21+
<dependency>
22+
<groupId>org.springframework.boot</groupId>
23+
<artifactId>spring-boot-dependencies</artifactId>
24+
<version>${spring-boot.version}</version>
25+
<type>pom</type>
26+
<scope>import</scope>
27+
</dependency>
28+
</dependencies>
29+
</dependencyManagement>
30+
<dependencies>
31+
<dependency>
32+
<groupId>io.rest-assured</groupId>
33+
<artifactId>rest-assured</artifactId>
34+
<version>${rest-assured.version}</version>
35+
</dependency>
36+
<dependency>
37+
<groupId>org.springframework.boot</groupId>
38+
<artifactId>spring-boot-starter-test</artifactId>
39+
<scope>test</scope>
40+
</dependency>
41+
</dependencies>
42+
43+
<build>
44+
<pluginManagement>
45+
<plugins>
46+
<plugin>
47+
<groupId>org.springframework.boot</groupId>
48+
<artifactId>spring-boot-maven-plugin</artifactId>
49+
<version>${spring-boot.version}</version>
50+
<configuration>
51+
<mainClass>${start-class}</mainClass>
52+
<!-- this is necessary as we're not using the Boot parent -->
53+
</configuration>
54+
</plugin>
55+
</plugins>
56+
</pluginManagement>
57+
</build>
58+
59+
<profiles>
60+
<profile>
61+
<id>thin-jar</id>
62+
<build>
63+
<plugins>
64+
<plugin>
65+
<groupId>org.springframework.boot</groupId>
66+
<artifactId>spring-boot-maven-plugin</artifactId>
67+
<dependencies>
68+
<!-- The following enables the "thin jar" deployment option. -->
69+
<dependency>
70+
<groupId>org.springframework.boot.experimental</groupId>
71+
<artifactId>spring-boot-thin-layout</artifactId>
72+
<version>${thin.version}</version>
73+
</dependency>
74+
</dependencies>
75+
</plugin>
76+
</plugins>
77+
</build>
78+
</profile>
79+
</profiles>
80+
81+
<properties>
82+
83+
<aspectjweaver.version>1.9.1</aspectjweaver.version>
84+
<rest-assured.version>3.3.0</rest-assured.version>
85+
<logback.version>1.4.4</logback.version>
86+
<org.slf4j.version>2.0.3</org.slf4j.version>
87+
<!-- for spring-boot 3 we need java 17 minimum -->
88+
<java.version>17</java.version>
89+
<spring-boot.version>3.1.4</spring-boot.version>
90+
91+
<!-- plugins -->
92+
<thin.version>1.0.22.RELEASE</thin.version>
93+
94+
</properties>
95+
96+
</project>

pom.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
</repository>
2222
<repository>
2323
<id>kotlin-eap</id>
24-
<url>http://dl.bintray.com/kotlin/kotlin-eap</url>
24+
<url>https://dl.bintray.com/kotlin/kotlin-eap/</url>
2525
</repository>
2626
</repositories>
2727

2828
<pluginRepositories>
2929
<pluginRepository>
3030
<id>kotlin-eap</id>
31-
<url>http://dl.bintray.com/kotlin/kotlin-eap</url>
31+
<url>https://dl.bintray.com/kotlin/kotlin-eap/</url>
3232
</pluginRepository>
3333
</pluginRepositories>
3434

@@ -283,6 +283,7 @@
283283

284284
<modules>
285285
<module>parent-boot-2</module>
286+
<module>parent-boot-3</module>
286287

287288
<module>core-kotlin-modules</module>
288289
<module>core-kotlin-companion</module>

spring-boot-kotlin/pom.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,20 @@
99

1010
<parent>
1111
<groupId>com.baeldung</groupId>
12-
<artifactId>parent-boot-2</artifactId>
12+
<artifactId>parent-boot-3</artifactId>
1313
<version>1.0.0-SNAPSHOT</version>
14-
<relativePath>../parent-boot-2</relativePath>
14+
<relativePath>../parent-boot-3</relativePath>
1515
</parent>
1616

1717
<dependencies>
1818
<dependency>
1919
<groupId>org.jetbrains.kotlinx</groupId>
2020
<artifactId>kotlinx-coroutines-core</artifactId>
2121
</dependency>
22+
<dependency>
23+
<groupId>org.springframework.boot</groupId>
24+
<artifactId>spring-boot-starter-web</artifactId>
25+
</dependency>
2226
<dependency>
2327
<groupId>org.jetbrains.kotlinx</groupId>
2428
<artifactId>kotlinx-coroutines-reactor</artifactId>
@@ -100,11 +104,9 @@
100104
</build>
101105

102106
<properties>
103-
<kotlin.version>1.7.0</kotlin.version>
104107
<r2dbc.version>1.0.0.RELEASE</r2dbc.version>
105108
<r2dbc-spi.version>1.0.0.RELEASE</r2dbc-spi.version>
106109
<h2-r2dbc.version>1.0.0.RELEASE</h2-r2dbc.version>
107-
<spring-boot.version>2.2.0.RELEASE</spring-boot.version>
108110
<mockito.version>3.1.0</mockito.version>
109111
<spring.integration.version>6.0.5</spring.integration.version>
110112
</properties>

spring-boot-kotlin/src/main/kotlin/com/baeldung/exceptionhandling/service/ArticleService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package com.baeldung.exceptionhandling.service
22

33
import com.baeldung.exceptionhandling.exception.ArticleNotFoundException
44
import com.baeldung.exceptionhandling.model.ArticleModel
5+
import jakarta.annotation.PostConstruct
56
import org.springframework.stereotype.Service
6-
import javax.annotation.PostConstruct
77

88
@Service
99
class ArticleService {

spring-boot-test-kotlin/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
<parent>
1212
<groupId>com.baeldung</groupId>
13-
<artifactId>parent-boot-2</artifactId>
13+
<artifactId>parent-boot-3</artifactId>
1414
<version>1.0.0-SNAPSHOT</version>
15-
<relativePath>../parent-boot-2</relativePath>
15+
<relativePath>../parent-boot-3</relativePath>
1616
</parent>
1717

1818
<dependencies>

spring-boot-test-kotlin/src/main/kotlin/com/baeldung/springboottestkotlin/BankAccount.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
package com.baeldung.springboottestkotlin
22

3-
import org.springframework.stereotype.Component
4-
import javax.persistence.GeneratedValue
5-
import javax.persistence.Entity
6-
import javax.persistence.GenerationType
7-
import javax.persistence.Id
3+
import jakarta.persistence.Entity
4+
import jakarta.persistence.GeneratedValue
5+
import jakarta.persistence.Id
86

97
@Entity
108
data class BankAccount (

spring-reactive-kotlin/pom.xml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
<parent>
1212
<groupId>com.baeldung</groupId>
13-
<artifactId>parent-boot-2</artifactId>
13+
<artifactId>parent-boot-3</artifactId>
1414
<version>1.0.0-SNAPSHOT</version>
15-
<relativePath>../parent-boot-2</relativePath>
15+
<relativePath>../parent-boot-3</relativePath>
1616
</parent>
1717

1818
<dependencies>
@@ -27,7 +27,7 @@
2727
<dependency>
2828
<groupId>org.springframework.boot</groupId>
2929
<artifactId>spring-boot-starter-data-r2dbc</artifactId>
30-
<version>2.3.0.RELEASE</version>
30+
<version>3.1.4</version>
3131
</dependency>
3232
<dependency>
3333
<groupId>org.springframework.boot</groupId>
@@ -40,7 +40,7 @@
4040
<dependency>
4141
<groupId>io.r2dbc</groupId>
4242
<artifactId>r2dbc-h2</artifactId>
43-
<version>0.8.0.RELEASE</version>
43+
<version>1.0.0.RELEASE</version>
4444
</dependency>
4545
<dependency>
4646
<groupId>com.fasterxml.jackson.module</groupId>
@@ -116,10 +116,4 @@
116116
</plugins>
117117
</build>
118118

119-
<properties>
120-
<java.version>1.8</java.version>
121-
<spring-boot.version>2.2.6.RELEASE</spring-boot.version>
122-
</properties>
123-
124-
125119
</project>

spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/config/DBConfiguration.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package com.baeldung.bootmicroservice.config;
22

33
import org.springframework.context.annotation.Configuration
4-
import org.springframework.data.r2dbc.core.DatabaseClient
4+
import org.springframework.r2dbc.core.DatabaseClient
55

66
@Configuration
77
class DBConfiguration(db: DatabaseClient) {
88
init {
9-
val initDb = db.execute {
9+
val initDb = db.sql {
1010
""" CREATE TABLE IF NOT EXISTS profile (
1111
id SERIAL PRIMARY KEY,
1212
first_name VARCHAR(20) NOT NULL,

0 commit comments

Comments
 (0)