diffplug / diffplug/spotless

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

Ouverte
#2,877 3 commentaires 10 réactions 0 personnes assignées Voir sur GitHub
bug
Langage dominant
Java
Étoiles
5.6k
Forks
559
Merge moyen
1 j 14 h
PR mergées (30 j)
43

Description

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)

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par l’exécution GitHub Actions liée et la configuration multiprojet décrite dans l’issue, en vous concentrant sur le build.gradle.kts racine manquant et le projet integTest. Comparez l’échec avec le contournement apply-false, puis déterminez si le comportement du plugin ou la documentation devrait changer. C’est terminé lorsque la configuration ne rencontre plus d’échec sans le contournement, ou lorsque la nouvelle exigence est clairement documentée.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
java
Domaine
build-system
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
48/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.