From d530cff65c086e1cdd666bf3b12663949ae7ffcc Mon Sep 17 00:00:00 2001 From: John Engelman Date: Mon, 20 Mar 2023 15:33:04 -0500 Subject: [PATCH] re-add the code that removes gradleApi from the api configuration --- build.gradle | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build.gradle b/build.gradle index 68701dd1f..3c0539a0a 100644 --- a/build.gradle +++ b/build.gradle @@ -50,6 +50,13 @@ tasks.withType(Test).configureEach { ) } +// Remove the gradleApi so it isn't merged into the jar file. +// This is required because 'java-gradle-plugin' adds gradleApi() to the 'api' configuration. +// See https://github.com/gradle/gradle/blob/master/subprojects/plugin-development/src/main/java/org/gradle/plugin/devel/plugins/JavaGradlePluginPlugin.java#L162 +configurations.named(JavaPlugin.API_CONFIGURATION_NAME) { + dependencies.remove(project.dependencies.gradleApi()) +} + tasks.named('shadowJar', ShadowJar) { from rootProject.file('LICENSE') from rootProject.file('NOTICE')