Spotless task fails #11

Closed
opened 2026-03-23 10:18:06 +01:00 by lars.winzer · 7 comments
lars.winzer commented 2026-03-23 10:18:06 +01:00 (Migrated from git.scicore.unibas.ch)

Bug Report

Summary

When running the spotlessCheck or spotlessApply gradle task, the build fails.

The error occured after the responseQueue field was added to the Session in #9.

Affected Component

Gradle, Spotless task

Steps to Reproduce

  1. Checkout commit 8d72a67b5e (git checkout 8d72a67b5e674301642ea4137c76c57d44cc151f )
  2. Run the spotlessCheck or spotlessApply gradle task
  3. Observe that the build fails.

Expected Behavior

Spotless tasks should lint and format the code as expected, without any errors.

Actual Behavior

Spotless tasks fail.

Stack Trace / Error Message

gradle: spotlessCheck 

<===----------> 25% EXECUTING [387ms]
> :spotlessJava

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':spotlessJavaCheck'.
> There were 1 lint error(s), they must be fixed or suppressed.
  src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/network/sessions/SessionManager.java:LINE_UNDEFINED google-java-format(java.lang.NoSuchMethodError) 'java.util.Queue com.sun.tools.javac.util.Log$DeferredDiagnosticHandler.getDiagnostics()' (...)
  Resolve these lints or suppress with `suppressLintsFor`

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights from a Build Scan (powered by Develocity).
> Get more help at https://help.gradle.org.
> Task :spotlessJavaCheck FAILED
3 actionable tasks: 1 executed, 2 up-to-date
Could not execute build using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-9.3.1-all.zip'.
 *  The terminal process terminated with exit code: 1.

Possible Cause

Spotless uses internal javac APIs, which are not stable and change with each version.

Currently we use google-java-format Version 1.25.2 . According to the maven central repository, this version was released back in Dec 12, 2024. Java 25 was released in September of 2025.

## Bug Report ### Summary When running the `spotlessCheck` or `spotlessApply` gradle task, the build fails. The error occured after the `responseQueue` field was added to the Session in #9. ### Affected Component Gradle, Spotless task ### Steps to Reproduce 1. Checkout commit 8d72a67b5e674301642ea4137c76c57d44cc151f (`git checkout 8d72a67b5e674301642ea4137c76c57d44cc151f` ) 2. Run the `spotlessCheck` or `spotlessApply` gradle task 3. Observe that the build fails. ### Expected Behavior Spotless tasks should lint and format the code as expected, without any errors. ### Actual Behavior Spotless tasks fail. ### Stack Trace / Error Message ``` gradle: spotlessCheck <===----------> 25% EXECUTING [387ms] > :spotlessJava FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':spotlessJavaCheck'. > There were 1 lint error(s), they must be fixed or suppressed. src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/network/sessions/SessionManager.java:LINE_UNDEFINED google-java-format(java.lang.NoSuchMethodError) 'java.util.Queue com.sun.tools.javac.util.Log$DeferredDiagnosticHandler.getDiagnostics()' (...) Resolve these lints or suppress with `suppressLintsFor` * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights from a Build Scan (powered by Develocity). > Get more help at https://help.gradle.org. > Task :spotlessJavaCheck FAILED 3 actionable tasks: 1 executed, 2 up-to-date Could not execute build using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-9.3.1-all.zip'. * The terminal process terminated with exit code: 1. ``` ### Possible Cause Spotless uses internal javac APIs, which are not stable and change with each version. Currently we use `google-java-format` Version `1.25.2` . According to the [maven central repository](https://mvnrepository.com/artifact/com.google.googlejavaformat/google-java-format/1.25.2), this version was released back in Dec 12, 2024. Java 25 was released in September of 2025.
lars.winzer commented 2026-03-23 10:20:32 +01:00 (Migrated from git.scicore.unibas.ch)

assigned to @lars.winzer

assigned to @lars.winzer
lars.winzer commented 2026-03-23 10:20:49 +01:00 (Migrated from git.scicore.unibas.ch)

added 15m of time spent at 2026-03-23 12:00:00 +0100

added 15m of time spent at 2026-03-23 12:00:00 +0100
lars.winzer commented 2026-03-23 10:21:12 +01:00 (Migrated from git.scicore.unibas.ch)

created branch issue/11-bump-spotless-version to address this issue

created branch [`issue/11-bump-spotless-version`](/cs108-fs26/Gruppe-13/-/compare/main...issue%2F11-bump-spotless-version) to address this issue
lars.winzer commented 2026-03-23 10:26:13 +01:00 (Migrated from git.scicore.unibas.ch)

changed the description

changed the description
lars.winzer commented 2026-03-23 10:31:17 +01:00 (Migrated from git.scicore.unibas.ch)

mentioned in merge request !43

mentioned in merge request !43
lars.winzer commented 2026-03-23 10:31:58 +01:00 (Migrated from git.scicore.unibas.ch)

added 5m of time spent at 2026-03-23 12:00:00 +0100

added 5m of time spent at 2026-03-23 12:00:00 +0100
lars.winzer commented 2026-03-23 10:33:19 +01:00 (Migrated from git.scicore.unibas.ch)

mentioned in commit 900bb4f26e

mentioned in commit 900bb4f26e84c54d7439281e658bda0c80a6d589
lars.winzer (Migrated from git.scicore.unibas.ch) closed this issue 2026-03-23 10:33:20 +01:00
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: University-of-Basel-Studentprojects/Programmierprojekt#11