Skip to content

Conversation

@shitikanth
Copy link

@shitikanth shitikanth commented Jan 9, 2026

Attempts to fix #2816

The maven plugin recalculates the list of dirty files using GitRatchetMaven::getDirtyFiles for each maven module and FormatterFactory. Calculating the list is expensive for large git repositories.

This PR introduces a cache that stores the set of dirty files for a given (repository, ratchetFrom) combination and returns the cached value when available.

On a large git repository with >20 modules and >10k java files, this change reduces the time to run spotless:check from ~7s to <1s.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spotless maven plugin is slow on large project with several maven submodules

1 participant