GradleException when multiple goals leave behind spotless-clean dir
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 静か
- 技術スタック
- java
- 領域
- build-system, tooling
調査の方向性
リンクされている openapi-generator-client プロジェクトで次のシーケンスを再現することから始めます: gradle clean openApiGenerate spotlessApply。続けて gradle spotlessCheck または gradle build を実行します。生成された build/spotless-clean/spotlessJava/build/generate-resources/main/src/main/java/ ディレクトリを調べ、別途 spotlessApply を実行した場合、または明示的なターゲットを指定した場合の動作と比較します。後続のチェックまたはビルドが手動でクリーンアップせずに成功すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
In my project: https://github.com/sixcorners/openapi-generator-client/tree/7b2dfb9cda3fe366f0a45f76b60b1a1961311d65
If you run
gradle clean openApiGenerate spotlessApply
it leaves behind a build/spotless-clean/spotlessJava/build/generate-resources/main/src/main/java/ directory. If you then run gradle spotlessCheck or gradle build it throws an error:
Caused by: org.gradle.api.GradleException: There were 0 lint error(s), they must be fixed or suppressed.
Resolve these lints or suppress with `suppressLintsFor`
at com.diffplug.gradle.spotless.SpotlessCheck.performAction(SpotlessCheck.java:85)
at com.diffplug.gradle.spotless.SpotlessCheck.performAction(SpotlessCheck.java:57)
if you delete build/spotless-clean or just run gradle spotlessApply again then gradle build works again.
kind of annoying but it's not a big deal.
specifying the target manually also fixes it.
spotless {
java {
googleJavaFormat()
target("src/main/java", "build/generate-resources/main/src/main/java")
}
kotlinGradle { ktfmt() }
}
I kind of thought the bug was something else but that disappeared so I kind of wonder if this can even be reproduced on other people's machines or if it will disappear too. It's also not a big deal since you can just run gradle spotlessApply in it's own cli invocation. Also running the build gradle goal in IntelliJ doesn't reproduce the issue. It's very fiddly. If you have trouble reproducing it I wouldn't mind if you just close this issue and leave it as a place for other people to find if they have something similar happen.
This is my gradle version running in a snap:
$ gradle --version
------------------------------------------------------------
Gradle 9.6.1
------------------------------------------------------------
Build time: 2026-06-26 14:25:50 UTC
Revision: 309d128bd9fe8c0b71311878fc660b9cbaa07c51
Kotlin: 2.3.21
Groovy: 4.0.32
Ant: Apache Ant(TM) version 1.10.17 compiled on April 6 2026
Launcher JVM: 25.0.3 (Ubuntu 25.0.3+9-2-26.04.2-Ubuntu)
Daemon JVM: /usr/lib/jvm/java-25-openjdk-amd64 (no Daemon JVM specified, using current Java home)
OS: Linux 7.0.0-27-generic amd64
- 主要言語
- Java
- スター
- 5.7k
- フォーク
- 560
- 平均マージ
- 1日 13時間
- マージ済み PR(30日)
- 43
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
diffplug/spotless のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 66/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
diffplug/spotless の issue をすべて見る
似ている issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
1.0.0-alpha2 Type/Improvement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
wso2/dpdp-accelerator#272 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
infinispan/infinispan#18150 ·
-
area/frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100