Skip to content

Commit 3254883

Browse files
authored
Support for Spring-Boot 3.1.0 #116 (#117)
* Support for Spring-Boot 3.1.0 #116
1 parent 69f7895 commit 3254883

File tree

16 files changed

+48
-35
lines changed

16 files changed

+48
-35
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Build
22

33
on:
44
push:
5-
branches: [master]
5+
branches: [main, 2.x]
66
pull_request:
7-
branches: [master]
7+
branches: [main, 2.x]
88

99
jobs:
1010
build-and-test:
@@ -13,7 +13,7 @@ jobs:
1313
- name: Install Java and Maven
1414
uses: actions/setup-java@v3
1515
with:
16-
java-version: 11
16+
java-version: 17
1717
distribution: 'temurin'
1818

1919
- name: Check out Git repository
@@ -30,4 +30,4 @@ jobs:
3030
name: codecov-umbrella
3131
fail_ci_if_error: true
3232
verbose: true
33-
java-version: 11
33+
java-version: 17

.github/workflows/gradle-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@v3
16-
- name: Set up JDK 11
16+
- name: Set up JDK 17
1717
uses: actions/setup-java@v3
1818
with:
19-
java-version: '11'
19+
java-version: '17'
2020
distribution: 'temurin'
2121
server-id: github
2222
settings-path: ${{ github.workspace }}

.java-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
17.0.6

build.gradle.kts

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
group = "com.trendyol"
2-
version = "2.1.0"
32

43
plugins {
54
kotlin("jvm") version "1.8.21"
65
id("kediatr-publishing") apply false
76
id("kediatr-coverage")
87
id("org.jlleitschuh.gradle.ktlint") version "11.3.2"
8+
id("com.palantir.git-version") version "3.0.0"
99
java
1010
}
1111

12+
val versionDetails: groovy.lang.Closure<com.palantir.gradle.gitversion.VersionDetails> by extra
13+
val details = versionDetails()
14+
version = details.lastTag
15+
// version = "3.0.0-SNAPSHOT"
16+
1217
jacoco {
1318
reportsDirectory.set(rootProject.buildDir.resolve("jacoco"))
1419
}
@@ -47,7 +52,7 @@ subprojectsOf("project") {
4752
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
4853
kotlinOptions {
4954
freeCompilerArgs = listOf("-Xjsr305=strict")
50-
jvmTarget = "11"
55+
jvmTarget = "17"
5156
}
5257
}
5358

@@ -68,19 +73,6 @@ subprojectsOf("project") {
6873
}
6974
}
7075

71-
allprojects {
72-
repositories {
73-
mavenCentral()
74-
maven {
75-
url = uri("https://oss.sonatype.org/content/repositories/snapshots")
76-
}
77-
78-
maven {
79-
url = uri("https://repo.maven.apache.org/maven2/")
80-
}
81-
}
82-
}
83-
8476
tasks.check {
8577
dependsOn(tasks.named("testCodeCoverageReport"))
8678
}

buildSrc/src/main/kotlin/kediatr-publishing.gradle.kts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ afterEvaluate {
3434
}
3535
}
3636
developers {
37+
developer {
38+
id.set("osoykan")
39+
name.set("Oguzhan Soykan")
40+
email.set("[email protected]")
41+
}
3742
developer {
3843
id.set("canerpatir")
3944
name.set("Caner Patir")
@@ -71,9 +76,13 @@ afterEvaluate {
7176
val signingKey = getProperty(projectKey = "gpg.key", environmentKey = "gpg_private_key")
7277
val passPhrase = getProperty(projectKey = "gpg.passphrase", environmentKey = "gpg_passphrase")
7378
signing {
74-
if (passPhrase == null) logger.warn(
75-
"The passphrase for the signing key was not found. Either provide it as env variable 'gpg_passphrase' or as project property 'gpg_passphrase'. Otherwise the signing might fail!"
76-
)
79+
if (passPhrase == null) {
80+
logger.warn(
81+
"The passphrase for the signing key was not found. " +
82+
"Either provide it as env variable 'gpg_passphrase' or as project property 'gpg_passphrase'. " +
83+
"Otherwise the signing might fail!"
84+
)
85+
}
7786
useInMemoryPgpKeys(signingKey, passPhrase)
7887
sign(publishing.publications)
7988
}

project/kediatr-spring-starter/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
val springVersion = "2.7.12"
1+
val springVersion = "3.1.0"
22
dependencies {
33
api(project(":project:kediatr-core"))
44
implementation("org.springframework.boot:spring-boot-starter:$springVersion")
5+
implementation("org.springframework.boot:spring-boot-autoconfigure:$springVersion")
56
}
67

78
dependencies {

project/kediatr-spring-starter/src/main/kotlin/com/trendyol/kediatr/spring/KediatRConfiguration.kt renamed to project/kediatr-spring-starter/src/main/kotlin/com/trendyol/kediatr/spring/KediatRAutoConfiguration.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ package com.trendyol.kediatr.spring
22

33
import com.trendyol.kediatr.Mediator
44
import com.trendyol.kediatr.MediatorBuilder
5+
import org.springframework.boot.autoconfigure.AutoConfiguration
56
import org.springframework.context.ApplicationContext
67
import org.springframework.context.annotation.Bean
7-
import org.springframework.context.annotation.Configuration
88

9-
@Configuration
10-
open class KediatRConfiguration {
9+
@AutoConfiguration
10+
open class KediatRAutoConfiguration {
1111
@Bean
1212
open fun kediatRSpringBeanProvider(applicationContext: ApplicationContext): KediatRSpringBeanProvider {
1313
return KediatRSpringBeanProvider(applicationContext)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Register EnableAutoConfiguration
22
org.springframework.boot.autoconfigure.EnableAutoConfiguration = \
3-
com.trendyol.kediatr.spring.KediatRConfiguration
3+
com.trendyol.kediatr.spring.KediatRAutoConfiguration
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
com.trendyol.kediatr.spring.KediatRAutoConfiguration

project/kediatr-spring-starter/src/test/kotlin/com/trendyol/kediatr/spring/CommandHandlerTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import kotlin.test.assertTrue
1717
private var springTestCounter = 0
1818
private var springAsyncTestCounter = 0
1919

20-
@SpringBootTest(classes = [KediatRConfiguration::class, MyCommandHandler::class])
20+
@SpringBootTest(classes = [KediatRAutoConfiguration::class, MyCommandHandler::class])
2121
class CommandHandlerTest {
2222

2323
init {

0 commit comments

Comments
 (0)