Regression in Gradle plugin v8.3.0: Cannot set the value of task ':integTest:spotlessJava' property 'taskService'
- Vorherrschende Sprache
- Java
- Sterne
- 5.6k
- Forks
- 559
- Ø Merge
- 1 T. 14 Std.
- Gemergte PRs (30 T.)
- 43
Beschreibung
See https://github.com/tbroyer/gradle-incap-helper/actions/runs/23116714774/job/67143450577?pr=53.
```
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)
Beitragsleitfaden
Rechercherichtung
Beginne mit dem verlinkten GitHub Actions-Lauf und dem im Issue beschriebenen Multi-Projekt-Setup und konzentriere dich auf die fehlende root build.gradle.kts und das integTest-Projekt. Vergleiche den Fehler mit dem apply-false-Workaround und ermittle anschließend, ob sich das Verhalten des Plugins oder die Dokumentation ändern sollte. Als erledigt gilt die Aufgabe, wenn das Setup ohne den Workaround nicht mehr fehlschlägt oder die neue Anforderung klar dokumentiert ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- build-system
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100