You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression in Gradle plugin v8.3.0: Cannot set the value of task ':integTest:spotlessJava' property 'taskService' #2877
Caused by: java.lang.IllegalArgumentException: Cannot set the value of task ':integTest:spotlessJava' property 'taskService' of type com.diffplug.gradle.spotless.SpotlessTaskService loaded with InstrumentingVisitableURLClassLoader(ClassLoaderScopeIdentifier.Id{coreAndPlugins:settings[:]:buildSrc[:]:root-project[:]:project-integTest(export)}) using a provider of type com.diffplug.gradle.spotless.SpotlessTaskService loaded with InstrumentingVisitableURLClassLoader(ClassLoaderScopeIdentifier.Id{coreAndPlugins:settings[:]:buildSrc[:]:root-project[:]:project-incap(export)}).
This can be caused by a plugin being applied to two sibling projects and then using a shared build service. To fix this, use `@ServiceReference` or add the problematic plugin with `apply false` to the root build script.
This happens in a multi-project build where the root project doesn't have a build.gradle.kts, so the spotless plugin isn't applied on the root project; and indeed adding it with apply false works around the error.
Either this should be documented as a new requirement, or the plugin should use @ServiceReference (if that makes a difference; but then also require Gradle >= 8)
Reacted by Kyle Johnson, Artem Gorbounov, Sven Jacobs, Viacheslav Chernyshev, Daniel Soneira, Vedran Pavic, Antoine Belvire, Carl Mastrangelo, Kacper Martela, Patrick Lampe Dittmer and 1 more
We've also hit this bug in a project that does have a root-level build.gradle.kts that applies some code coverage and static analysis plugins. Unfortunately, I can't share the logs as it's proprietary.
Can this be looked into? We apply spotless as part of a shared binary java plugin that defines the necessary conventions. Forcing the users to also add it to their root build with apply false is not ideal.
Thanks @tbroyer for the detailed report and @v-chernyshev for the extra context. The full stack trace with both classloader names and the apply false workaround made the root cause quick to pin down.
Cause: since #2854 (8.3.0) every copy of the plugin registers its build service as SpotlessTaskService. Sibling projects that apply Spotless with different plugin sets, and no common parent applying it, each get their own classloader and so their own copy of the plugin. The second copy then receives the first copy's service, whose class comes from another classloader, and fails.
Fix: each copy uses the first service name not taken by another copy (SpotlessTaskService, SpotlessTaskService1, …). Nothing changes with a single classloader, and isolated projects keep working.
Sibling classloaders
Before
After
spotlessApply + spotlessCheck
❌
✅
with configuration cache
❌
✅
Workaround until released: apply false in the root build.
Activity
v-chernyshev commentedon Mar 16, 2026
We've also hit this bug in a project that does have a root-level
build.gradle.ktsthat applies some code coverage and static analysis plugins. Unfortunately, I can't share the logs as it's proprietary.Update Spotless to 8.4.0
schaarda commentedon Mar 25, 2026
We had the same error when we started using
org.gradle.configuration-cache=trueRemoved this and it worked again.
v-chernyshev commentedon Jun 26, 2026
Can this be looked into? We apply
spotlessas part of a shared binary java plugin that defines the necessary conventions. Forcing the users to also add it to their root build withapply falseis not ideal.Pankraz76 commentedon Nov 22, 2026
Thanks @tbroyer for the detailed report and @v-chernyshev for the extra context. The full stack trace with both classloader names and the
apply falseworkaround made the root cause quick to pin down.Fix: #3202
Cause: since #2854 (8.3.0) every copy of the plugin registers its build service as
SpotlessTaskService. Sibling projects that apply Spotless with different plugin sets, and no common parent applying it, each get their own classloader and so their own copy of the plugin. The second copy then receives the first copy's service, whose class comes from another classloader, and fails.Fix: each copy uses the first service name not taken by another copy (
SpotlessTaskService,SpotlessTaskService1, …). Nothing changes with a single classloader, and isolated projects keep working.spotlessApply+spotlessCheckWorkaround until released:
apply falsein the root build.Fix taskService type clash when Spotless is applied to sibling projec…
Fix taskService type clash when Spotless is applied to sibling projects