From 364b20bcd6a7e53704441a383a1a5d34fbdf0ac2 Mon Sep 17 00:00:00 2001 From: Karthik Date: Fri, 7 Aug 2026 14:14:24 -0400 Subject: [PATCH] Fix publish/sign task ordering for the shaded publication With two publications (maven + shaded), both sign tasks write their .asc into build/libs and each publish task reads from build/libs, so Gradle's strict validation flags an implicit dependency between a publish task and the other publication's sign task and fails the release build (signShadedPublication). Order all AbstractPublishToMaven tasks after all Sign tasks. Verified locally: reproduced the failure, then confirmed publishToMavenLocal succeeds with both publications signed in the correct order. --- build.gradle | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build.gradle b/build.gradle index 39a7d39..9f91958 100644 --- a/build.gradle +++ b/build.gradle @@ -184,4 +184,14 @@ publishing { } } } +} + +// With two publications (maven + shaded), both sign tasks write their .asc into build/libs, and each +// publish task reads from build/libs — so Gradle's strict validation flags an implicit dependency +// between publish and the *other* publication's sign task and fails the build. Order all publish +// tasks after all sign tasks to make the dependency explicit. +import org.gradle.api.publish.maven.tasks.AbstractPublishToMaven +import org.gradle.plugins.signing.Sign +tasks.withType(AbstractPublishToMaven).configureEach { + mustRunAfter(tasks.withType(Sign)) } \ No newline at end of file