Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Gradle does not detect java sources for `java-gradle-plugin`

Open
#437 0 comments 1 reaction 1 assignee View on GitHub

@nedtwigg is already working on this.

Since Jan 26, 2023.

Assessment

This issue has not been assessed yet.

Description

bug

With gradle 4.1 and spotless 3.6.0, the following worked. With gradle 5.6 and spotless 3.24.1, it silently fails to format sources.

apply plugin: 'java-gradle-plugin'
spotless {
  java { ... }
}

This is similar to #111 (spotless fails to detect android sources). Just like #111, the workaround is to list the target explicitly: target 'src/main/java/**/*.java', 'src/test/java/**/*.java'.

Silently not formatting is a bummer. Would perhaps be good for Spotless to report a warning if a format has been described, but the target turned out to be empty.

Project which reproduces this issue:

Dominant language
Java
Stars
5.7k
Forks
560
Avg merge
1d 13h
Merged PRs (30d)
43

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from diffplug/spotless

All issues in diffplug/spotless

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.