Skip to content

Commit

Permalink
Upgrade to Spring Boot 3.0.2 and Java 17
Browse files Browse the repository at this point in the history
  • Loading branch information
arey committed Jan 28, 2023
1 parent 869bd74 commit 34f5b48
Show file tree
Hide file tree
Showing 18 changed files with 38 additions and 39 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
Expand Down
13 changes: 7 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
description = "Kotlin version of the Spring Petclinic application"
group = "org.springframework.samples"
// Align with Spring Version
version = "2.7.4"
version = "3.0.2"

java.sourceCompatibility = JavaVersion.VERSION_1_8
java.sourceCompatibility = JavaVersion.VERSION_17

plugins {
val kotlinVersion = "1.7.10"
id("org.springframework.boot") version "2.7.4"
id("io.spring.dependency-management") version "1.0.11.RELEASE"
val kotlinVersion = "1.7.22"
id("org.springframework.boot") version "3.0.2"
id("io.spring.dependency-management") version "1.1.0"
id("com.google.cloud.tools.jib") version "3.1.4"
kotlin("jvm") version kotlinVersion
kotlin("plugin.spring") version kotlinVersion
Expand All @@ -23,7 +23,7 @@ val fontAwesomeVersion = "4.7.0"
tasks {
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "17"
freeCompilerArgs = listOf("-Xjsr305=strict")
}
}
Expand All @@ -47,6 +47,7 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-thymeleaf")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.glassfish.jaxb:jaxb-runtime")
implementation("javax.cache:cache-api")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlin:kotlin-reflect")
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This is a [Kotlin](https://kotlinlang.org/) version of the [spring-petclinic][]
## Technologies used

* Language: Kotlin
* Core framework: Spring Boot 2 with Spring Framework 5 Kotlin support
* Core framework: Spring Boot 3 with Spring Framework 6 Kotlin support
* Server: Apache Tomcat
* Web framework: Spring MVC
* Templates: Thymeleaf and Bootstrap 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
package org.springframework.samples.petclinic.model

import java.io.Serializable
import javax.persistence.GeneratedValue
import javax.persistence.GenerationType
import javax.persistence.Id
import javax.persistence.MappedSuperclass
import jakarta.persistence.GeneratedValue
import jakarta.persistence.GenerationType
import jakarta.persistence.Id
import jakarta.persistence.MappedSuperclass

/**
* Simple JavaBean domain object with an id property. Used as a base class for objects
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package org.springframework.samples.petclinic.model

import javax.persistence.Column
import javax.persistence.MappedSuperclass
import jakarta.persistence.Column
import jakarta.persistence.MappedSuperclass


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
package org.springframework.samples.petclinic.model


import javax.persistence.Column
import javax.persistence.MappedSuperclass
import javax.validation.constraints.NotEmpty
import jakarta.persistence.Column
import jakarta.persistence.MappedSuperclass
import jakarta.validation.constraints.NotEmpty

/**
* Simple JavaBean domain object representing an person.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ package org.springframework.samples.petclinic.owner

import org.springframework.samples.petclinic.model.Person
import java.util.*
import javax.persistence.*
import javax.validation.constraints.Digits
import javax.validation.constraints.NotEmpty
import jakarta.persistence.*
import jakarta.validation.constraints.Digits
import jakarta.validation.constraints.NotEmpty

/**
* Simple JavaBean domain object representing an owner.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.InitBinder
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.PostMapping
import javax.validation.Valid
import jakarta.validation.Valid

/**
* @author Juergen Hoeller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import org.springframework.samples.petclinic.model.NamedEntity
import org.springframework.samples.petclinic.visit.Visit
import java.time.LocalDate
import java.util.*
import javax.persistence.*
import jakarta.persistence.*

/**
* Simple business object representing a owner.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import org.springframework.util.StringUtils
import org.springframework.validation.BindingResult
import org.springframework.web.bind.WebDataBinder
import org.springframework.web.bind.annotation.*
import javax.validation.Valid
import jakarta.validation.Valid

/**
* @author Juergen Hoeller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package org.springframework.samples.petclinic.owner

import org.springframework.samples.petclinic.model.NamedEntity;

import javax.persistence.Entity;
import javax.persistence.Table;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;

/**
* @author Juergen Hoeller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import org.springframework.stereotype.Controller
import org.springframework.validation.BindingResult
import org.springframework.web.bind.WebDataBinder
import org.springframework.web.bind.annotation.*
import javax.validation.Valid
import jakarta.validation.Valid

/**
* @author Juergen Hoeller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
package org.springframework.samples.petclinic.vet

import org.springframework.samples.petclinic.model.NamedEntity
import javax.persistence.Entity
import javax.persistence.Table
import jakarta.persistence.Entity
import jakarta.persistence.Table

/**
* Models a {@link Vet Vet's} specialty (for example, dentistry).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
package org.springframework.samples.petclinic.vet

import org.springframework.samples.petclinic.model.Person
import javax.persistence.*
import javax.xml.bind.annotation.XmlElement
import jakarta.persistence.*
import jakarta.xml.bind.annotation.XmlElement

/**
* Simple JavaBean domain object representing a veterinarian.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package org.springframework.samples.petclinic.vet

import javax.xml.bind.annotation.XmlRootElement
import jakarta.xml.bind.annotation.XmlRootElement

/**
* Simple domain object representing a list of veterinarians. Mostly here to be used for the 'vets' [ ].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ package org.springframework.samples.petclinic.visit
import org.springframework.format.annotation.DateTimeFormat
import org.springframework.samples.petclinic.model.BaseEntity
import java.time.LocalDate
import javax.persistence.*
import javax.validation.constraints.NotEmpty
import jakarta.persistence.*
import jakarta.validation.constraints.NotEmpty

/**
* Simple JavaBean domain object representing a visit.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.junit.jupiter.api.Test
import org.springframework.context.i18n.LocaleContextHolder
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
import java.util.*
import javax.validation.Validator
import jakarta.validation.Validator

/**
* @author Michael Isvy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorContro
import org.springframework.boot.web.servlet.error.ErrorController
import org.springframework.web.bind.annotation.ControllerAdvice
import org.springframework.web.bind.annotation.ExceptionHandler
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.ResponseBody
import org.springframework.web.servlet.ModelAndView
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse
import jakarta.servlet.http.HttpServletRequest
import jakarta.servlet.http.HttpServletResponse

/**
* This advice is necessary because MockMvc is not a real servlet environment, therefore it does not redirect error
Expand Down

0 comments on commit 34f5b48

Please sign in to comment.