License Scanning crashes on gradle 7 projects
Summary
When scanning a Gradle 7 Android project the scanner fails due to some incompatibilities of the included version of https://github.com/hierynomus/license-gradle-plugin (v0.15.0) with Gradle 7.
Steps to reproduce
Run the licence_scanning job on a Gradle 7 project ans look into the ci logs.
What is the current bug behavior?
Job crashes. No licenses detected. See attached logs.
What is the expected correct behavior?
Jobs runs successfully and detects all licenses correctly.
Relevant logs and/or screenshots
[v3.28.10] 2021-06-20T19:16:49.666+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-06-20T19:16:49.666+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
2021-06-20T19:16:49.666+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-06-20T19:16:49.666+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
2021-06-20T19:16:49.666+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Some problems were found with the configuration of task ':downloadLicenses' (type 'DownloadLicenses').
2021-06-20T19:16:49.666+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] - Type 'DownloadLicenses' property 'html' has redundant getters: 'getHtml()' and 'isHtml()'.
2021-06-20T19:16:49.666+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-06-20T19:16:49.666+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Reason: Boolean property 'html' has both an `is` and a `get` getter.
2021-06-20T19:16:49.666+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-06-20T19:16:49.666+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Possible solutions:
2021-06-20T19:16:49.667+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 1. Remove one of the getters.
2021-06-20T19:16:49.667+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 2. Annotate one of the getters with @Internal.
2021-06-20T19:16:49.667+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-06-20T19:16:49.667+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#redundant_getters for more details about this problem.
2021-06-20T19:16:49.667+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] - Type 'DownloadLicenses' property 'ignoreFatalParseErrors' has redundant getters: 'getIgnoreFatalParseErrors()' and 'isIgnoreFatalParseErrors()'.
2021-06-20T19:16:49.667+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-06-20T19:16:49.667+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Reason: Boolean property 'ignoreFatalParseErrors' has both an `is` and a `get` getter.
2021-06-20T19:16:49.667+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-06-20T19:16:49.667+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Possible solutions:
2021-06-20T19:16:49.667+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 1. Remove one of the getters.
2021-06-20T19:16:49.667+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 2. Annotate one of the getters with @Internal.
2021-06-20T19:16:49.667+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-06-20T19:16:49.667+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#redundant_getters for more details about this problem.
2021-06-20T19:16:49.667+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] - Type 'DownloadLicenses' property 'includeProjectDependencies' has redundant getters: 'getIncludeProjectDependencies()' and 'isIncludeProjectDependencies()'.
2021-06-20T19:16:49.667+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-06-20T19:16:49.667+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Reason: Boolean property 'includeProjectDependencies' has both an `is` and a `get` getter.
2021-06-20T19:16:49.667+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-06-20T19:16:49.667+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Possible solutions:
2021-06-20T19:16:49.667+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 1. Remove one of the getters.
2021-06-20T19:16:49.667+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 2. Annotate one of the getters with @Internal.
2021-06-20T19:16:49.668+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-06-20T19:16:49.668+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#redundant_getters for more details about this problem.
2021-06-20T19:16:49.668+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] - Type 'DownloadLicenses' property 'json' has redundant getters: 'getJson()' and 'isJson()'.
2021-06-20T19:16:49.668+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-06-20T19:16:49.668+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Reason: Boolean property 'json' has both an `is` and a `get` getter.
2021-06-20T19:16:49.668+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-06-20T19:16:49.668+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Possible solutions:
2021-06-20T19:16:49.668+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 1. Remove one of the getters.
2021-06-20T19:16:49.668+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 2. Annotate one of the getters with @Internal.
2021-06-20T19:16:49.668+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-06-20T19:16:49.668+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#redundant_getters for more details about this problem.
2021-06-20T19:16:49.668+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] - Type 'DownloadLicenses' property 'reportByDependency' has redundant getters: 'getReportByDependency()' and 'isReportByDependency()'.
2021-06-20T19:16:49.668+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-06-20T19:16:49.668+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Reason: Boolean property 'reportByDependency' has both an `is` and a `get` getter.
2021-06-20T19:16:49.668+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-06-20T19:16:49.668+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Possible solutions:
2021-06-20T19:16:49.668+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 1. Remove one of the getters.
2021-06-20T19:16:49.668+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 2. Annotate one of the getters with @Internal.
2021-06-20T19:16:49.668+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-06-20T19:16:49.668+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#redundant_getters for more details about this problem.
2021-06-20T19:16:49.668+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-06-20T19:16:49.669+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
2021-06-20T19:16:49.669+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. Run with --scan to get full insights.
2021-06-20T19:16:49.669+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-06-20T19:16:49.669+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
2021-06-20T19:16:49.669+0000 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger]
2021-06-20T19:16:49.669+0000 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 10s
Possible fixes
v0.15.0 of the license-gradle-plugin is currently used in the license-finder: https://gitlab.com/gitlab-org/security-products/analyzers/license-finder/-/blob/main/config/files/.gradle/init.gradle#L7
The issue seems to be fixed since v0.16.1. See: https://github.com/hierynomus/license-gradle-plugin/issues/191#issuecomment-831972567
So perhaps this can be fixed with an dependency update.
Implementation plan
-
Update gradle init script https://gitlab.com/gitlab-org/security-products/analyzers/license-finder/-/blob/main/config/files/.gradle/init.gradle
to use new version oflicense-gradle-plugin
(v0.16.1
). -
Add integration test to spec/integration/java/
to test analyzer behavior with gradle 7. -
Bump version of the analyzer and add changelog entry. -
Release new version of analyzer.