Skip to content

Commit

Permalink
refactor: update Spring Boot to 3.2.0 and Kotlin 1.9.21
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnymillergh committed Nov 29, 2023
1 parent 82e5c88 commit 60349a1
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 44 deletions.
10 changes: 5 additions & 5 deletions .github/actions/gradle-submodule-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Gradle Submodule Build
description: Gradle build for submodule

inputs:
temurinVersion:
description: "Temurin JDK version"
javaVersion:
description: "Java version"
required: true
submodulePath:
description: "The path to the submodule"
Expand All @@ -22,9 +22,9 @@ runs:
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: ${{ inputs.temurinVersion }}
distribution: 'temurin'
cache: 'gradle'
java-version: ${{ inputs.javaVersion }}
distribution: "liberica"
cache: "gradle"
- name: Grant Execution Permission for `gradlew`
shell: bash
run: chmod +x gradlew
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ name: Java CI with Gradle
on:
push:
branches:
- 'main'
- 'feature/**'
- "main"
- "feature/**"
paths-ignore:
- '**.md'
- '_config.yml'
- "**.md"
- "_config.yml"
pull_request:
branches:
- 'main'
- "main"

env:
TEMURIN_VERSION: '17.0.7+7'
JAVA_VERSION: "21"

jobs:
build-api-gateway:
Expand All @@ -26,7 +26,7 @@ jobs:
- name: "Gradle Build :: api-gateway"
uses: ./.github/actions/gradle-submodule-build
with:
temurinVersion: ${{ env.TEMURIN_VERSION }}
temurinVersion: ${{ env.JAVA_VERSION }}
submodulePath: api-gateway
dockerHubUsername: ${{ secrets.DOCKER_HUB_USERNAME }}
dockerHubPassword: ${{ secrets.DOCKER_HUB_PASSWORD }}
Expand All @@ -37,7 +37,7 @@ jobs:
- name: "Gradle Build :: auth-center"
uses: ./.github/actions/gradle-submodule-build
with:
temurinVersion: ${{ env.TEMURIN_VERSION }}
temurinVersion: ${{ env.JAVA_VERSION }}
submodulePath: auth-center
dockerHubUsername: ${{ secrets.DOCKER_HUB_USERNAME }}
dockerHubPassword: ${{ secrets.DOCKER_HUB_PASSWORD }}
Expand All @@ -48,7 +48,7 @@ jobs:
- name: "Gradle Build :: maf-mis"
uses: ./.github/actions/gradle-submodule-build
with:
temurinVersion: ${{ env.TEMURIN_VERSION }}
temurinVersion: ${{ env.JAVA_VERSION }}
submodulePath: maf-mis
dockerHubUsername: ${{ secrets.DOCKER_HUB_USERNAME }}
dockerHubPassword: ${{ secrets.DOCKER_HUB_PASSWORD }}
Expand All @@ -59,7 +59,7 @@ jobs:
- name: "Gradle Build :: oss-center"
uses: ./.github/actions/gradle-submodule-build
with:
temurinVersion: ${{ env.TEMURIN_VERSION }}
temurinVersion: ${{ env.JAVA_VERSION }}
submodulePath: oss-center
dockerHubUsername: ${{ secrets.DOCKER_HUB_USERNAME }}
dockerHubPassword: ${{ secrets.DOCKER_HUB_PASSWORD }}
Expand All @@ -70,7 +70,7 @@ jobs:
- name: "Gradle Build :: spring-boot-admin"
uses: ./.github/actions/gradle-submodule-build
with:
temurinVersion: ${{ env.TEMURIN_VERSION }}
temurinVersion: ${{ env.JAVA_VERSION }}
submodulePath: spring-boot-admin
dockerHubUsername: ${{ secrets.DOCKER_HUB_USERNAME }}
dockerHubPassword: ${{ secrets.DOCKER_HUB_PASSWORD }}
Expand All @@ -82,9 +82,9 @@ jobs:
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: ${{env.TEMURIN_VERSION}}
distribution: 'temurin'
cache: 'gradle'
java-version: ${{env.JAVA_VERSION}}
distribution: "liberica"
cache: "gradle"
- name: Grant Execution Permission for `gradlew`
run: chmod +x gradlew
- name: Check Dependencies Version with Gradle `com.github.ben-manes.versions` Plugin
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ HELP.md
nohup.out
*.log
*.gz
.fastRequest/

### STS ###
.apt_generated
Expand Down Expand Up @@ -61,4 +62,3 @@ gradle-app.setting

# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties

3 changes: 1 addition & 2 deletions api-gateway/api-gateway-bootstrap/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ jib {
properties = mapOf("excludeDevtools" to "true")
}
}
val temurinTag: String by project
from.image = "eclipse-temurin:${temurinTag}"
from.image = "${libs.versions.jreImage.get()}:${libs.versions.jreTag.get()}"
val dockerHubRepositoryPrefix: String by project
val projectArtifactId: String by project
val apiGatewayArtifactId: String by project
Expand Down
3 changes: 1 addition & 2 deletions auth-center/auth-center-bootstrap/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ jib {
properties = mapOf("excludeDevtools" to "true")
}
}
val temurinTag: String by project
from.image = "eclipse-temurin:${temurinTag}"
from.image = "${libs.versions.jreImage.get()}:${libs.versions.jreTag.get()}"
val dockerHubRepositoryPrefix: String by project
val projectArtifactId: String by project
val authCenterArtifactId: String by project
Expand Down
12 changes: 6 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import enforcer.rules.RequireGradleVersion
import enforcer.rules.RequireJavaVendor
import enforcer.rules.RequireJavaVersion
import org.gradle.api.JavaVersion.VERSION_17
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
import org.gradle.api.tasks.testing.logging.TestLogEvent.*
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
Expand All @@ -32,8 +31,9 @@ plugins {
alias(libs.plugins.project.enforcer)
}

java.sourceCompatibility = VERSION_17
java.targetCompatibility = VERSION_17
java {
sourceCompatibility = JavaVersion.VERSION_21
}

// Disable building any artifacts for the rootProject
tasks.withType<Jar> {
Expand Down Expand Up @@ -88,8 +88,8 @@ subprojects {

tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = VERSION_17.majorVersion
freeCompilerArgs += "-Xjsr305=strict"
jvmTarget = "21"
}
}

Expand Down Expand Up @@ -201,7 +201,7 @@ enforce {
}
rule(RequireJavaVersion::class.java) {
this.setEnforcerLevel("ERROR")
this.setProperty("version", "[${libs.versions.temurinVersion.get()}]")
this.setProperty("version", "[${libs.versions.javaVersion.get()},)")
}
}

Expand Down
18 changes: 10 additions & 8 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

[versions]
# https://github.com/gradle/gradle/releases/tag/v7.6
gradle = "8.1.1"
javaVendor = "Eclipse Adoptium"
gradle = "8.4"
javaVendor = "BellSoft"
# https://github.com/adoptium/temurin17-binaries/releases/tag/jdk-17.0.5%2B8
temurinVersion = "17.0.7"
# Don't use alpine or slim version, https://hub.docker.com/_/eclipse-temurin/tags?page=1&name=17.0.7_7-jre
temurinTag = "17.0.7_7-jre"
javaVersion = "21"
# Don't use alpine or slim version, https://hub.docker.com/r/bellsoft/liberica-runtime-container/tags?page=1&name=jre-21
# docker pull bellsoft/liberica-runtime-container:jre-21-cds-musl
jreImage = "bellsoft/liberica-runtime-container"
jreTag = "jre-21-cds-musl"
dockerHubRepositoryPrefix = "docker.io/ijohnnymiller/"
sas = "0.4.0"
spring-boot-admin = "3.0.4"
Expand All @@ -26,10 +28,10 @@ shardingsphere = "5.2.1"
snakeyaml = "1.33"
jjwt = "0.11.5"
poi = "5.2.3"
kotlin = "1.8.21"
spring-boot = "3.1.3"
kotlin = "1.9.21"
spring-boot = "3.2.0"
spring-cloud = "2022.0.4"
spring-dependency-management = "1.1.0"
spring-dependency-management = "1.1.4"
jib = "3.3.2"
git-version = "0.15.0"
versions = "0.42.0"
Expand Down
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion maf-mis/maf-mis-bootstrap/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jib {
properties = mapOf("excludeDevtools" to "true")
}
}
from.image = "eclipse-temurin:${libs.versions.temurinTag.get()}"
from.image = "${libs.versions.jreImage.get()}:${libs.versions.jreTag.get()}"
val projectArtifactId: String by project
val mafMisArtifactId: String by project
to.image = "${libs.versions.dockerHubRepositoryPrefix.get()}$projectArtifactId.$mafMisArtifactId"
Expand Down
3 changes: 1 addition & 2 deletions oss-center/oss-center-bootstrap/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ jib {
properties = mapOf("excludeDevtools" to "true")
}
}
val temurinTag: String by project
from.image = "eclipse-temurin:${temurinTag}"
from.image = "${libs.versions.jreImage.get()}:${libs.versions.jreTag.get()}"
val dockerHubRepositoryPrefix: String by project
val projectArtifactId: String by project
val ossCenterArtifactId: String by project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ jib {
properties = mapOf("excludeDevtools" to "true")
}
}
val temurinTag: String by project
from.image = "eclipse-temurin:${temurinTag}"
from.image = "${libs.versions.jreImage.get()}:${libs.versions.jreTag.get()}"
val dockerHubRepositoryPrefix: String by project
val projectArtifactId: String by project
val springBootAdminArtifactId: String by project
Expand Down

0 comments on commit 60349a1

Please sign in to comment.