diffplug / diffplug/spotless

Regression in Gradle plugin v8.3.0: Cannot set the value of task ':integTest:spotlessJava' property 'taskService'

Aperta
#2,877 3 commenti 10 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Java
Stelle
5.6k
Fork
559
Merge medio
1g 14h
PR unite (30g)
43

Descrizione

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)

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con l’esecuzione di GitHub Actions collegata e con la configurazione multiprogetto descritta nell’issue, concentrandoti sul build.gradle.kts root mancante e sul progetto integTest. Confronta il fallimento con la soluzione alternativa apply-false, quindi determina se debbano cambiare il comportamento del plugin o la documentazione. Il lavoro è completato quando la configurazione non fallisce più senza la soluzione alternativa, oppure quando il nuovo requisito è documentato chiaramente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
build-system
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.