diffplug / diffplug/spotless

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

オープン
#2,877 コメント 3 件 リアクション 10 件 担当者 0 名 GitHub で見る
bug
主要言語
Java
スター
5.6k
フォーク
559
平均マージ
1日 14時間
マージ済み PR(30日)
43

説明

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)

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

リンクされた GitHub Actions の実行と、issue で説明されているマルチプロジェクト構成から始め、欠落している root build.gradle.kts と integTest プロジェクトに焦点を当てます。失敗を apply-false の回避策と比較し、そのうえで plugin の動作またはドキュメントを変更すべきか判断します。回避策なしで構成が失敗しなくなるか、新しい要件が明確に文書化されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
build-system
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。