Migrated the Liberty Gradle Plugin from Gradle 8 to Gradle 9#1045
Migrated the Liberty Gradle Plugin from Gradle 8 to Gradle 9#1045venmanyarun merged 201 commits intoOpenLiberty:mainfrom
Conversation
…ssues (AbstractIntegrationTest.groovy, LibertyTest.groovy)
…e/utils/, Moved all the server verification and cleanup methods from StopTask to ServerUtils, Updated StopTask to use the methods from ServerUtils
…tempts from 10 to 5 and lowered the maximum wait time from 5000ms to 4000ms
… a new class has been added for Process/Resource operations.
…address if the .liberty_plugin_force_stopped file is not delete or .liberty_plugin_force_stopped is not available
…utils and re-used it from StartTask.groovy and StopTask.groovy
…he closequitely method from ProcessUtils.groovy
… ServerUtils.groovy
…pForceStoppedMarker
…on_migration Gradle version migration and Core Infrastructure Tests fixes
…o support gradle 9 syntax
…s, private methods were having visibility issues within the groovy class
…o support gradle 9 syntax
…ly and newly fixed test files. build.gradle updates to support gradle 9 character encoding and java toolchain language version
Feature/gradle9
…radle9_JAN-2026
…y more failures happening
…mpatibility and spring boot version
…radle9_JAN-2026
… signing keys while still supporting signed release publishing
src/main/groovy/io/openliberty/tools/gradle/tasks/AbstractServerTask.groovy
Outdated
Show resolved
Hide resolved
src/main/groovy/io/openliberty/tools/gradle/tasks/StopTask.groovy
Outdated
Show resolved
Hide resolved
src/test/groovy/io/openliberty/tools/gradle/TestLooseApplicationWithToolchain.groovy
Outdated
Show resolved
Hide resolved
…t and Arquilian updates and Java 25 updates
There was a problem hiding this comment.
see one remaining comment...approving so you won't be held up on merging...but please modify the support statements in the readme.
You lost some important info about which Java version is supported with which plugin version. Your new bullets on Gradle version support are good, except the second bullet also supports Java 21 I believe.
|
@sajeerzeji Please add back the paragraph on Java support in the readme. You lost key info when you created your two new bullets on Gradle version support. You just need to add another sentence saying that as of release 4.0.0, we support Java 17, 21 and 25. And probably mention to check out our toolchain support for running their applications on older versions of Java. |
I have updated the README as suggested |
Migrates the Liberty Gradle Plugin from Gradle 8 to Gradle 9, covering all plugin source changes, test fixes, build infrastructure updates, and CI pipeline improvements. Issue #868
Summary of Changes
Gradle Wrapper Update
Build Configuration (
build.gradle)java-gradle-pluginplugin; migratedpluginBundle-->gradlePluginblockplugin-publish-pluginfrom0.12.0to1.0.0processResourcesexclusion for duplicate plugin descriptortasks.register()artifacts { archives ... }blockfailOnNoDiscoveredTests = falsefor test taskTestSpringBootApplication20*tests on Gradle 9Plugin Source Changes
Method Visibility (
private-->protected)Gradle 9 uses Groovy 4, where closures in subclasses can no longer access private methods from parent classes (reference). Changed the following methods from
privatetoprotected:installMultipleApps(),installLooseApplication(),addWarEmbeddedLib(),isSupportedType(),installProjectArchive(),hasJavaSourceFiles(),addLibrary(),checkAndLoadInstallExtensionProperties(),buildInstallLibertyMap(),loadLibertyRuntimeProperties()writeJvmOptions(),handleServerEnvFileAndProperties(),setServerEnvWithAppendServerEnvHelper(),setServerEnvPathHelperForAppendServerEnv(),setServerEnvHelper(),mergeSpecialPropsFromInstallServerEnvIfAbsent(),convertServerEnvToProperties(),combineServerEnvProperties(),writeServerEnvProperties(),writeConfigDropinsServerVariables(),makeParentDirectory(),findServerEnvFile(),findJvmOptionsFile(),readConfigFileLines(),populateEnvironmentVariablesMap(),addToolchainEnvToProcessBuilder(),addToolchainEnvToServerTask()configureDefaults(),isLibertyInstalledAndValid()getServerFeatureUtil()getAppNamesFromServerXml()Removed Incorrect
@InternalAnnotationsIn Gradle 9,
@Internalis only valid on task input/output property getters. Removed from non-getter methods:isLibertyInstalledAndValid(),getServerFeatureUtil(),mergeJvmOptions(),findServerEnvFile(),findJvmOptionsFile(),readConfigFileLines(),populateEnvironmentVariablesMap(),addToolchainEnvToProcessBuilder(),addToolchainEnvToServerTask()Dependency Resolution (Gradle 9 API Changes)
detachedConfiguration().resolve()instead ofconfiguration.files(dep)getDependencyProject()withgetPath()+findProject()inLiberty.groovy,DeployTask.groovy,DevTaskHelper.groovyLoose Application: Configuration and Artifact Changes
warOnly,jarOnly) for EAR/WAR artifact exposure between projects, replacing reliance onarchivesconfiguration which changed behavior in Gradle 9 (reference)Server Stop: Resource Release Verification
StopTaskwithverifyServerFullyStopped()andforceCleanupServerResources()to ensure file locks are released before subsequentcleantasksRefactored
writeJvmOptions()-->mergeJvmOptions()mergeJvmOptions()method fromwriteJvmOptions()for use in toolchain JAVA_HOME precedence checksProperty Value Parsing Fix
splitNameValueto usesplit(":", 2)instead ofsplit(":")to correctly handle property values containing colonsTest Fixes
Java Compilation Properties (across ~50+ test build files)
Updated deprecated
sourceCompatibility = 1.8syntax to Gradle 9 compatible block:Test Areas Fixed
AbstractIntegrationTest,LibertyTestBaseDevTest,DevTest,DevRecompileTest,PollingDevTestDevSkipInstallFeatureTest,DevSkipInstallFeatureConfigTestInstallLiberty_installDir_full_lifecycle_TestLibertyApplicationConfigurationTest,TestAppConfig,TestAppListsWithObjects,TestGetAppNamesLibertyPackage_looseApplication_TesttestCreateLibertyFiles,testCreateLibertyInlineProperties,testCreateLibertyDefaultConfigDirTestCompileJSP,TestCompileJSPSource17(updated expected Java source level from 8 to 17)verifyTimeoutSuccess*testsGenerateFeaturesTest,BaseGenerateFeaturesTestloose-ear-test,loose-ear-earlibs-test,loose-war-with-loose-jarConfigureArquillianTest(pinned to Gradle 8.5 for Spring dependency management plugin compatibility; updated Spring dependency management plugin from1.0.4.RELEASEto1.1.7)InstallLiberty_runtimeUrl_upToDate_Test(updated URLs from 21.0.0.1 -> 21.0.0.4)test_spring_boot_*_30.gradlefiles (Java 17 compatibility, Spring Boot 3.1.2 -> 3.4.1)Other Test Fixes
LibertyTest: Added explicitlibertyStopbeforecleanto prevent file lock errorsGenerateFeaturesTest: Updated assertions to check key parts of messages instead of exact strings; increased process timeout from 20s to 50sInstallLiberty_installDir_full_lifecycle_Test: Renamed server from'test'to specific name to prevent pid matching killing the Gradle test processTestLooseApplicationWithToolchain: Fixed assertions for merged toolchain implementation0.8.0to1.0.0in all testsettings.gradlefilesCI Pipeline (
gradle.yml)[21, 17, 25]; distribution changed fromadopttotemurin25.0.0.10