FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':example'.
> Cannot invoke method setFrom() on null object
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':example'.
at org.gradle.configuration.project.LifecycleProjectEvaluator.wrapException(LifecycleProjectEvaluator.java:75)
at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:68)
[...]
Caused by: java.lang.NullPointerException: Cannot invoke method setFrom() on null object
at org.kordamp.gradle.plugin.jacoco.JacocoPlugin.adjustClassDirectories(JacocoPlugin.groovy:382)
at jdk.internal.reflect.GeneratedMethodAccessor4030.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.kordamp.gradle.plugin.jacoco.JacocoPlugin$_configureJacocoReportTask_closure4.doCall(JacocoPlugin.groovy:285)
[...]
Setting jacoco exclusion in child project causes NPE. I am using Kotlin DSL. Latest Kordamp version (0.43.0).
Example configuration:
This results in:
I suspect that the issue might be caused by https://github.com/kordamp/kordamp-gradle-plugins/blob/c914d314b5978199331599c297789fd828ccd5dd/plugins/jacoco-gradle-plugin/src/main/groovy/org/kordamp/gradle/plugin/jacoco/JacocoPlugin.groovy#L382 – shouldn't there be
t.additionalClassDirs
(property) instead oft.additionalClassDirs()
(method call)?Build environment: