From c8b243ab9e07708f90f2996d7172eb0180020b48 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 16:57:46 +0000 Subject: [PATCH 1/3] Java 21 migration: update Gradle build config - Bump spring-boot-gradle-plugin from 2.0.2.RELEASE to 3.2.5 - Set source/target compatibility to 21 - Replace deprecated compile/testCompile with implementation/testImplementation - Rename bootJar baseName/version to archiveBaseName/archiveVersion - Bump Gradle wrapper from 4.6 to 8.7 (required for Java 21) Co-Authored-By: Phil Bedford --- build.gradle | 14 +++++++------- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 09f1083..1d6346e 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ buildscript { mavenCentral() } dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.2.RELEASE") + classpath("org.springframework.boot:spring-boot-gradle-plugin:3.2.5") } } @@ -14,19 +14,19 @@ apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' bootJar { - baseName = 'gs-spring-boot' - version = '0.1.0' + archiveBaseName = 'gs-spring-boot' + archiveVersion = '0.1.0' } repositories { mavenCentral() } -sourceCompatibility = 1.8 -targetCompatibility = 1.8 +sourceCompatibility = 21 +targetCompatibility = 21 dependencies { - compile("org.springframework.boot:spring-boot-starter-web") - testCompile("junit:junit") + implementation("org.springframework.boot:spring-boot-starter-web") + testImplementation("junit:junit") } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a2ff3cc..51ff6a3 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip From 22aa7dabe5f2dfba83fa61350777f3db258be3ca Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 16:57:53 +0000 Subject: [PATCH 2/3] =?UTF-8?q?Java=2021=20migration=20=E2=80=94=20Maven?= =?UTF-8?q?=20build=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Bump Spring Boot parent from 2.0.2.RELEASE to 3.2.5 - Bump java.version from 1.8 to 21 - Remove spring-boot-properties-migrator (only needed for 1.x→2.x) - Bump Maven wrapper distribution from 3.3.9 to 3.9.6 (required for Java 21) Co-Authored-By: Phil Bedford --- .mvn/wrapper/maven-wrapper.properties | 2 +- pom.xml | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index c954cec..4465bd9 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -1 +1 @@ -distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip +distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip diff --git a/pom.xml b/pom.xml index 63f5cbd..766a67a 100644 --- a/pom.xml +++ b/pom.xml @@ -11,15 +11,10 @@ org.springframework.boot spring-boot-starter-parent - 2.0.2.RELEASE + 3.2.5 - - org.springframework.boot - spring-boot-properties-migrator - runtime - org.springframework.boot spring-boot-starter-web @@ -35,7 +30,7 @@ - 1.8 + 21 From afc119ba0f0ae6e653648d8cd4a2c3e93849812e Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 16:59:06 +0000 Subject: [PATCH 3/3] Java 21 migration: Application.java source changes - Fix H2 2.x DROP TABLE syntax (DROP TABLE IF EXISTS customers) - Update deprecated JdbcTemplate.query() to varargs overload - Replace defunct gturnquist-quoters URL with jsonplaceholder placeholder Co-Authored-By: Phil Bedford --- src/main/java/hello/Application.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/hello/Application.java b/src/main/java/hello/Application.java index 7cf8faf..47c8365 100644 --- a/src/main/java/hello/Application.java +++ b/src/main/java/hello/Application.java @@ -36,7 +36,7 @@ public static void main(String[] args) { } RestTemplate restTemplate = new RestTemplate(); - Quote quote = restTemplate.getForObject("http://gturnquist-quoters.cfapps.io/api/random", Quote.class); + Quote quote = restTemplate.getForObject("https://jsonplaceholder.typicode.com/posts/1", Quote.class); log.info(quote.toString()); } @@ -50,7 +50,7 @@ public RestTemplate restTemplate(RestTemplateBuilder builder) { public CommandLineRunner run(RestTemplate restTemplate) throws Exception { return args -> { Quote quote = restTemplate.getForObject( - "http://gturnquist-quoters.cfapps.io/api/random", Quote.class); + "https://jsonplaceholder.typicode.com/posts/1", Quote.class); log.info(quote.toString()); }; } @@ -63,7 +63,7 @@ public CommandLineRunner run(RestTemplate restTemplate) throws Exception { public void run(String... args) throws Exception { log.info("Creating tables"); - jdbcTemplate.execute("DROP TABLE customers IF EXISTS"); + jdbcTemplate.execute("DROP TABLE IF EXISTS customers"); jdbcTemplate.execute("CREATE TABLE customers(id SERIAL, first_name VARCHAR(255), last_name VARCHAR(255))"); // Split up the array of whole names into an array of first/last names @@ -80,8 +80,9 @@ public void run(String... args) throws Exception { log.info("Querying for customer records where first_name = 'Josh':"); jdbcTemplate.query( - "SELECT id, first_name, last_name FROM customers WHERE first_name = ?", new Object[]{"Josh"}, - (rs, rowNum) -> new Customer(rs.getLong("id"), rs.getString("first_name"), rs.getString("last_name")) + "SELECT id, first_name, last_name FROM customers WHERE first_name = ?", + (rs, rowNum) -> new Customer(rs.getLong("id"), rs.getString("first_name"), rs.getString("last_name")), + "Josh" ).forEach(customer -> log.info(customer.toString())); }