Skip to content

Commit 1ca36a8

Browse files
authored
Upgrade Spring Boot (#14)
* Skip SecretManager PostProcessor during AOT processing * Upgrade Spring Boot * Enhance README with compatibility details * ktlint 적용 * Update reflection info
1 parent ffb54cb commit 1ca36a8

File tree

16 files changed

+143
-62
lines changed

16 files changed

+143
-62
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
- name: Checkout
1515
uses: actions/checkout@v2
1616

17-
- name: Set up JDK 17
17+
- name: Set up JDK 21
1818
uses: actions/setup-java@v3
1919
with:
20-
java-version: '17'
20+
java-version: '21'
2121
distribution: 'temurin'
2222

2323
- name: Run Lint

.github/workflows/publish-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
2121
aws-region: ap-northeast-2
2222

23-
- name: Set up JDK 17
23+
- name: Set up JDK 21
2424
uses: actions/setup-java@v3
2525
with:
26-
java-version: '17'
26+
java-version: '21'
2727
distribution: 'temurin'
2828

2929
- name: Publish release

.github/workflows/publish-snapshot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
2121
aws-region: ap-northeast-2
2222

23-
- name: Set up JDK 17
23+
- name: Set up JDK 21
2424
uses: actions/setup-java@v3
2525
with:
26-
java-version: '17'
26+
java-version: '21'
2727
distribution: 'temurin'
2828

2929
- name: Publish snapshot

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
- name: Checkout
1515
uses: actions/checkout@v2
1616

17-
- name: Set up JDK 17
17+
- name: Set up JDK 21
1818
uses: actions/setup-java@v3
1919
with:
20-
java-version: '17'
20+
java-version: '21'
2121
distribution: 'temurin'
2222

2323
- name: Run Lint

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22
## 와플스튜디오 스프링 라이브러리
33
- 와플스튜디오에서 사용하는 스프링 라이브러리 모음
44

5+
## 배포된 라이브러리 위치
6+
- AWS CodeArtifact
7+
- 리포지토리 URL: `https://wafflestudio-405906814034.d.codeartifact.ap-northeast-1.amazonaws.com/maven/spring-waffle/`
8+
9+
## Compatibility
10+
- version 2.0.0 ~
11+
- JDK 21 이상
12+
- spring boot 4.0 이상
13+
- version 1.0.0 ~ 1.0.4
14+
- JDK 17 이상
15+
- spring boot 3.x
16+
517
## 사용법
618
### AWS 설정
719
- AWS 콘솔에 로그인

build.gradle.kts

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
12
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
23
import java.io.FileInputStream
34
import java.io.FileOutputStream
45
import java.util.Properties
56

67
plugins {
7-
id("org.springframework.boot") version "3.2.4" apply false
8-
id("io.spring.dependency-management") version "1.1.4"
9-
kotlin("jvm") version "1.8.0"
10-
kotlin("plugin.spring") version "1.8.0"
8+
id("org.springframework.boot") version "4.0.1" apply false
9+
kotlin("jvm") version "2.2.0"
10+
kotlin("plugin.spring") version "2.2.0"
1111
id("org.jlleitschuh.gradle.ktlint") version "12.2.0"
1212
id("maven-publish")
1313
}
1414

15-
java.sourceCompatibility = JavaVersion.VERSION_17
15+
java.sourceCompatibility = JavaVersion.VERSION_21
16+
java.targetCompatibility = JavaVersion.VERSION_21
1617

1718
allprojects {
1819
repositories {
@@ -32,13 +33,9 @@ allprojects {
3233
withJavadocJar()
3334
}
3435

35-
dependencyManagement {
36-
imports {
37-
mavenBom("org.springframework.boot:spring-boot-dependencies:3.2.4")
38-
}
39-
}
40-
4136
dependencies {
37+
implementation(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES))
38+
4239
implementation(kotlin("stdlib"))
4340
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
4441
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core")
@@ -73,9 +70,9 @@ allprojects {
7370
}
7471

7572
tasks.withType<KotlinCompile> {
76-
kotlinOptions {
77-
freeCompilerArgs = listOf("-Xjsr305=strict")
78-
jvmTarget = "17"
73+
compilerOptions {
74+
freeCompilerArgs.add("-Xjsr305=strict")
75+
jvmTarget.set(JvmTarget.JVM_21)
7976
}
8077
}
8178

@@ -84,7 +81,7 @@ allprojects {
8481
}
8582
}
8683

87-
task("updateVersion") {
84+
tasks.register("updateVersion") {
8885
properties["releaseVersion"]?.let { releaseVersion ->
8986
val newSnapshotVersion =
9087
(releaseVersion as String).split(".").let {

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#Sun May 04 17:42:48 UTC 2025
22
kotlin.code.style=official
3-
version=1.1.0-SNAPSHOT
3+
version=2.0.0
44
group=com.wafflestudio.spring
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

spring-boot-starter-waffle-secret-manager/src/main/kotlin/com/wafflestudio/spring/secretsmanager/config/SecretsManagerEnvironmentPostProcessor.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package com.wafflestudio.spring.secretsmanager.config
22

33
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
44
import com.fasterxml.jackson.module.kotlin.readValue
5+
import org.springframework.boot.EnvironmentPostProcessor
56
import org.springframework.boot.SpringApplication
6-
import org.springframework.boot.env.EnvironmentPostProcessor
77
import org.springframework.core.env.ConfigurableEnvironment
88
import org.springframework.core.env.MapPropertySource
99
import software.amazon.awssdk.regions.Region
@@ -18,6 +18,10 @@ class SecretsManagerEnvironmentPostProcessor : EnvironmentPostProcessor {
1818
environment: ConfigurableEnvironment,
1919
application: SpringApplication,
2020
) {
21+
val isAotProcessing = environment.getProperty("spring.aot.processing", Boolean::class.java, false)
22+
if (isAotProcessing) {
23+
return
24+
}
2125
val secretNamesProperty = environment.getProperty("secret-names") ?: return
2226
val secretNames = secretNamesProperty.split(",")
2327
val secrets = mutableMapOf<String, Any>()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
org.springframework.boot.env.EnvironmentPostProcessor=com.wafflestudio.spring.secretsmanager.config.SecretsManagerEnvironmentPostProcessor
1+
org.springframework.boot.EnvironmentPostProcessor=com.wafflestudio.spring.secretsmanager.config.SecretsManagerEnvironmentPostProcessor

0 commit comments

Comments
 (0)