Skip to content

Commit

Permalink
imp: upgrade boot3 and jdk 17
Browse files Browse the repository at this point in the history
  • Loading branch information
DongGeon0908 committed Nov 15, 2023
1 parent 5e8fad4 commit 78b450d
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
kotlin-version: [ "1.8.22" ]
java-version: [ "11" ]
java-version: [ "17" ]

steps:
- name: Checkout code
Expand Down Expand Up @@ -46,4 +46,4 @@ jobs:
run: ./gradlew test sonar --info
env:
GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Spring Webflux + Coroutine Boilerplate

### Spec
- SpringBoot v2.7.17
- jdk 11
- SpringBoot v3.1.5
- jdk 17
19 changes: 10 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
val kotlinVersion = "1.8.22"

id("org.springframework.boot") version "2.7.17"
id("io.spring.dependency-management") version "1.0.15.RELEASE"
id("org.springframework.boot") version "3.1.5"
id("io.spring.dependency-management") version "1.1.3"
kotlin("jvm") version kotlinVersion
kotlin("plugin.spring") version kotlinVersion
kotlin("plugin.jpa") version kotlinVersion
Expand All @@ -23,7 +23,7 @@ plugins {
}

group = "com.goofy"
java.sourceCompatibility = JavaVersion.VERSION_11
java.sourceCompatibility = JavaVersion.VERSION_17

repositories {
mavenCentral()
Expand Down Expand Up @@ -56,7 +56,7 @@ object DependencyVersion {
/** external */
const val QUERYDSL_VERSION = "5.0.0"
const val ARROW_FX_VERSION = "1.1.3"
const val SPRINGDOC_VERSION = "1.6.15"
const val SPRINGDOC_VERSION = "2.2.0"
const val JAVADOC_SCRIBE_VERSION = "0.15.0"
const val KOTLIN_LOGGING_VERSION = "2.0.11"
const val LOGBACK_ENCODER_VERSION = "6.6"
Expand Down Expand Up @@ -92,9 +92,7 @@ dependencies {
implementation("io.arrow-kt:arrow-fx-stm:${DependencyVersion.ARROW_FX_VERSION}")

/** swagger */
implementation("org.springdoc:springdoc-openapi-webflux-ui:${DependencyVersion.SPRINGDOC_VERSION}")
implementation("org.springdoc:springdoc-openapi-kotlin:${DependencyVersion.SPRINGDOC_VERSION}")
implementation("org.springdoc:springdoc-openapi-javadoc:${DependencyVersion.SPRINGDOC_VERSION}")
implementation("org.springdoc:springdoc-openapi-starter-webflux-ui:${DependencyVersion.SPRINGDOC_VERSION}")
kapt("com.github.therapi:therapi-runtime-javadoc-scribe:${DependencyVersion.JAVADOC_SCRIBE_VERSION}")

/** database */
Expand Down Expand Up @@ -127,7 +125,7 @@ tasks.getByName<Jar>("jar") {
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "11"
jvmTarget = "17"
}
}

Expand Down Expand Up @@ -210,7 +208,10 @@ sonarqube {
property("sonar.language", "Kotlin")
property("sonar.sourceEncoding", "UTF-8")
property("sonar.test.inclusions", "**/*Test.java")
property("sonar.exclusions", "**/test/**, **/Q*.kt, **/*Doc*.kt, **/resources/** ,**/*Application*.kt , **/*Config*.kt, **/*Dto*.kt, **/*Request*.kt, **/*Response*.kt ,**/*Exception*.kt ,**/*ErrorCode*.kt")
property(
"sonar.exclusions",
"**/test/**, **/Q*.kt, **/*Doc*.kt, **/resources/** ,**/*Application*.kt , **/*Config*.kt, **/*Dto*.kt, **/*Request*.kt, **/*Response*.kt ,**/*Exception*.kt ,**/*ErrorCode*.kt"

Check failure on line 213 in build.gradle.kts

View workflow job for this annotation

GitHub Actions / CI (1.8.22, 17)

[ktlint] reported by reviewdog 🐶 Exceeded max line length (140) Raw Output: build.gradle.kts:213:1: error: Exceeded max line length (140) (standard:max-line-length)

Check failure on line 213 in build.gradle.kts

View workflow job for this annotation

GitHub Actions / CI (1.8.22, 17)

[ktlint] reported by reviewdog 🐶 Missing trailing comma before ")" Raw Output: build.gradle.kts:213:189: error: Missing trailing comma before ")" (standard:trailing-comma-on-call-site)
)
property("sonar.java.coveragePlugin", "jacoco")
property("sonar.java.binaries", "$buildDir/classes")
property("sonar.coverage.jacoco.xmlReportPaths", "$buildDir/reports/jacoco.xml")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.goofy.boilerplate.common.dto

import com.goofy.boilerplate.exception.ErrorCode
import jakarta.validation.ConstraintViolationException
import kotlinx.coroutines.CancellationException
import org.hibernate.TypeMismatchException
import org.springframework.core.codec.DecodingException
import org.springframework.web.bind.support.WebExchangeBindException
import org.springframework.web.server.ServerWebInputException
import javax.validation.ConstraintViolationException

data class ErrorResponse(
val errorCode: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.goofy.boilerplate.config.database

import com.zaxxer.hikari.HikariDataSource
import jakarta.persistence.EntityManagerFactory
import org.hibernate.cfg.AvailableSettings
import org.springframework.beans.factory.annotation.Qualifier
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory
Expand All @@ -19,7 +20,6 @@ import org.springframework.orm.jpa.JpaTransactionManager
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
import org.springframework.transaction.PlatformTransactionManager
import org.springframework.transaction.annotation.EnableTransactionManagement
import javax.persistence.EntityManagerFactory
import javax.sql.DataSource

@Configuration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.goofy.boilerplate.config.validation

import jakarta.validation.ClockProvider
import jakarta.validation.ParameterNameProvider
import org.hibernate.validator.internal.engine.DefaultClockProvider
import org.springframework.core.KotlinReflectionParameterNameDiscoverer
import org.springframework.core.LocalVariableTableParameterNameDiscoverer
Expand All @@ -9,16 +11,14 @@ import org.springframework.core.StandardReflectionParameterNameDiscoverer
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
import java.lang.reflect.Constructor
import java.lang.reflect.Method
import javax.validation.ClockProvider
import javax.validation.ParameterNameProvider
import kotlin.reflect.jvm.kotlinFunction

class CoroutinesLocalValidatorFactoryBean : LocalValidatorFactoryBean() {
override fun getClockProvider(): ClockProvider {
return DefaultClockProvider.INSTANCE
}

override fun postProcessConfiguration(configuration: javax.validation.Configuration<*>) {
override fun postProcessConfiguration(configuration: jakarta.validation.Configuration<*>) {
super.postProcessConfiguration(configuration)

val discoverer = PrioritizedParameterNameDiscoverer().apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.goofy.boilerplate.config.web

import io.swagger.v3.oas.models.OpenAPI
import io.swagger.v3.oas.models.info.Info
import org.springdoc.core.SpringDocUtils
import org.springdoc.core.utils.SpringDocUtils
import org.springframework.boot.info.BuildProperties
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.goofy.boilerplate.exception.advice

import com.goofy.boilerplate.common.dto.ErrorResponse
import jakarta.validation.ConstraintViolationException
import kotlinx.coroutines.CancellationException
import mu.KotlinLogging
import org.hibernate.TypeMismatchException
Expand All @@ -13,7 +14,6 @@ import org.springframework.web.bind.annotation.RestControllerAdvice
import org.springframework.web.bind.support.WebExchangeBindException
import org.springframework.web.server.ServerWebExchange
import org.springframework.web.server.ServerWebInputException
import javax.validation.ConstraintViolationException

@RestControllerAdvice
class ExceptionHandler {
Expand Down

0 comments on commit 78b450d

Please sign in to comment.