From bca9748d262e485b9ffed56eab08bd9bcd3a54b1 Mon Sep 17 00:00:00 2001 From: Wolfgang Klenk Date: Tue, 8 Oct 2024 12:58:41 +0200 Subject: [PATCH] fix(gradle): Also check for non-empty resolution alternatives Starting with Gradle 8.2, a property that defines if a Gradle configuration is deprecated can be an empty list instead of just null. This is misinterpreted by the Gradle analyzer plugin, and all Gradle configurations are considered deprecated. As a result, no dependencies for Gradle configurations are returned. Fixes #9255. Signed-off-by: Wolfgang Klenk --- plugins/package-managers/gradle/src/main/resources/init.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/package-managers/gradle/src/main/resources/init.gradle b/plugins/package-managers/gradle/src/main/resources/init.gradle index 27a67f0ef9351..80bd78e41117f 100644 --- a/plugins/package-managers/gradle/src/main/resources/init.gradle +++ b/plugins/package-managers/gradle/src/main/resources/init.gradle @@ -409,7 +409,7 @@ class AbstractOrtDependencyTreePlugin implements Plugin { // available since Gradle 6.0. boolean isDeprecatedForResolving = false if (configuration.metaClass.respondsTo(configuration, 'getResolutionAlternatives')) { - isDeprecatedForResolving = configuration.getResolutionAlternatives() != null + isDeprecatedForResolving = configuration.getResolutionAlternatives() } return canBeResolved && !isDeprecatedForResolving