From 3461f22d8090bc5ec837e4b2a7ccd351eb9f0d20 Mon Sep 17 00:00:00 2001 From: Frank Bregulla Date: Mon, 28 Aug 2023 09:03:30 +0200 Subject: [PATCH] update example-springboot to spring boot 3.x --- .idea/misc.xml | 2 +- .travis.yml | 2 +- build.gradle | 6 +++--- example-client/build.gradle | 6 +++--- example-springboot/build.gradle | 6 +++--- .../java/de/otto/edison/hal/example/web/HomeController.java | 2 +- .../de/otto/edison/hal/example/web/ProductsController.java | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 9765026..3a9d81e 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -4,5 +4,5 @@ - + \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index eb0a409..d3addca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: java jdk: - - openjdk8 + - openjdk17 install: /bin/true # skip gradle assemble script: ./gradlew check jacocoTestReport after_success: diff --git a/build.gradle b/build.gradle index 0045d03..955c3c4 100644 --- a/build.gradle +++ b/build.gradle @@ -44,7 +44,7 @@ test { jacocoTestReport { reports { - xml.enabled true + xml.required = true } } @@ -205,8 +205,8 @@ allprojects { } } - targetCompatibility = JavaVersion.VERSION_1_8 - sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_17 } // This function converts 1.8 -> 8 diff --git a/example-client/build.gradle b/example-client/build.gradle index 6468f8e..29d42bd 100644 --- a/example-client/build.gradle +++ b/example-client/build.gradle @@ -11,11 +11,11 @@ apply plugin: 'application' mainClassName = 'de.otto.edison.hal.example.Client' jar { - baseName = 'edison-hal-example-client' + archiveBaseName = 'edison-hal-example-client' } -targetCompatibility = JavaVersion.VERSION_1_8 -sourceCompatibility = JavaVersion.VERSION_1_8 +targetCompatibility = JavaVersion.VERSION_17 +sourceCompatibility = JavaVersion.VERSION_17 repositories { mavenCentral() diff --git a/example-springboot/build.gradle b/example-springboot/build.gradle index 4f2de8c..e9d6abc 100644 --- a/example-springboot/build.gradle +++ b/example-springboot/build.gradle @@ -1,6 +1,6 @@ buildscript { ext { - springBootVersion = '2.7.8' + springBootVersion = '3.1.3' } repositories { mavenCentral() @@ -18,8 +18,8 @@ jar { archiveBaseName = 'edison-hal-example-springboot' } -targetCompatibility = JavaVersion.VERSION_1_8 -sourceCompatibility = JavaVersion.VERSION_1_8 +targetCompatibility = JavaVersion.VERSION_17 +sourceCompatibility = JavaVersion.VERSION_17 repositories { mavenCentral() diff --git a/example-springboot/src/main/java/de/otto/edison/hal/example/web/HomeController.java b/example-springboot/src/main/java/de/otto/edison/hal/example/web/HomeController.java index 547f950..af53a8b 100644 --- a/example-springboot/src/main/java/de/otto/edison/hal/example/web/HomeController.java +++ b/example-springboot/src/main/java/de/otto/edison/hal/example/web/HomeController.java @@ -5,7 +5,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import static de.otto.edison.hal.Link.linkBuilder; import static de.otto.edison.hal.Links.linkingTo; diff --git a/example-springboot/src/main/java/de/otto/edison/hal/example/web/ProductsController.java b/example-springboot/src/main/java/de/otto/edison/hal/example/web/ProductsController.java index 060dfaa..3dfb592 100644 --- a/example-springboot/src/main/java/de/otto/edison/hal/example/web/ProductsController.java +++ b/example-springboot/src/main/java/de/otto/edison/hal/example/web/ProductsController.java @@ -6,12 +6,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Optional; import static java.util.Optional.ofNullable; -import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND; +import static jakarta.servlet.http.HttpServletResponse.SC_NOT_FOUND; /** * REST controller for products. diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 070cb70..db9a6b8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists