As see be seen from the stack trace, the NullPointerException happens when the Gretty plugin tries to configure the JaCoCo plugin.
Gradle is moving very fast and APIs are often deprecated and removed at least one major version later (e.g. deprecated in 5.0 and removed in 6.0). There is often about one to two years for buildscript and plugin authors to react to these deprecations.
Though you don't mention it, I am quite sure you are using a more than three year old version of the original Gretty plugin:
At least I can reproduce the issue and the same stack trace using that version.
Though it looks like it was abandoned years ago, this isn't the case. Instead, the plugin has been forked and moved to a new namespace (from org.akhikhl.gretty
to org.gretty
):
There is even a bug report describing the NullPointerException issue (going all the way back to Gradle 4.6).
So to fix it, change the Gretty plugin ID to the new namespace and use a recent version:
plugins {
id "org.gretty" version "3.0.3"
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…