From b1b31870e1ceb189e81ba7f74c47e92e8e4798c9 Mon Sep 17 00:00:00 2001 From: ATX Bot Date: Wed, 8 Jul 2026 10:18:08 -0700 Subject: [PATCH] Step 1: Upgrade Java from 11 to 21 - Updated pom.xml (java.version, compiler/surefire/javadoc plugins, JUnit 5.10.2, AssertJ 3.27.7), build.gradle (testImplementation/testRuntimeOnly, removed jcenter, updated IDEA config, fixed testCompileClasspath), gradle.properties (versions and compatibility), gradle-wrapper.properties (Gradle 8.11). Build status: Success (13 tests pass) --- build.gradle | 13 ++++++------- gradle.properties | 8 ++++---- gradle/wrapper/gradle-wrapper.properties | 2 +- pom.xml | 15 +++++++-------- 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/build.gradle b/build.gradle index 221e716..8fe95c1 100644 --- a/build.gradle +++ b/build.gradle @@ -39,16 +39,15 @@ ext { repositories { mavenCentral() - jcenter() } dependencies { // Compile-time dependencies // Test dependencies - testCompile("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}") - testCompile("org.assertj:assertj-core:${assertjVersion}") - testRuntime("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}") + testImplementation("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}") + testImplementation("org.assertj:assertj-core:${assertjVersion}") + testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}") } // ********************************************************************************************************************* @@ -63,8 +62,8 @@ eclipse { idea { project { - jdkName = '11' - languageLevel = '11' + jdkName = '21' + languageLevel = '21' } } @@ -85,7 +84,7 @@ test { task javadocTests(type: Javadoc, group: "documentation" ) { description = 'Generates Javadoc API documentation for the test source code.' source = sourceSets.test.allJava - classpath = configurations.testCompile + classpath = configurations.testCompileClasspath options.links(project.ext.javadocLinks) options.addBooleanOption('html5',true) } diff --git a/gradle.properties b/gradle.properties index 11ecfb0..1e82f90 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,12 +3,12 @@ # dependencies. Configuring the properties in this file avoids the need to edit build.gradle except when build logic # needs to change. # ********************************************************************************************************************** -assertjVersion=3.11.1 +assertjVersion=3.27.7 description=Java 11 code examples group=com.neiljbrown -junitJupiterVersion=5.3.2 +junitJupiterVersion=5.10.2 # Set Java source & class versions to use when compiling. Needs to be defined after applying java plugin to take affect -sourceCompatibility=11 -targetCompatibility=11 +sourceCompatibility=21 +targetCompatibility=21 # Default project version unless overridden version=0.0.1-snapshot diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 75c31a3..bbc9841 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.10.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-all.zip diff --git a/pom.xml b/pom.xml index c1ba53a..7b1a87e 100644 --- a/pom.xml +++ b/pom.xml @@ -12,10 +12,10 @@ https://github.com/neiljbrown/java11-examples - 11 + 21 UTF-8 - 5.3.2 - 3.11.1 + 5.10.2 + 3.27.7 @@ -44,20 +44,19 @@ org.apache.maven.plugins maven-compiler-plugin - 3.7.0 + 3.11.0 - ${java.version} - ${java.version} + ${java.version} maven-surefire-plugin - 2.22.0 + 3.2.5 org.apache.maven.plugins maven-javadoc-plugin - 3.0.1 + 3.6.3 -html5