diffplug / spotless

Keep your code spotless
Apache License 2.0
4.36k stars 443 forks source link

spotless configuration crash when using convention plugins combined with settings plugins. #1633

Open JavierSegoviaCordoba opened 1 year ago

JavierSegoviaCordoba commented 1 year ago

Stacktrace:

* What went wrong:
A problem occurred configuring root project 'foo'.
> Could not resolve all files for configuration ':spotless1316845977'.
   > Cannot resolve external dependency com.facebook:ktfmt:0.43 because no repositories are defined.
     Required by:
         project :

If a convention plugin applies Spotless on the root project and this convention plugin is applied via a settings plugin, I got this crash.

I think there is a warning from Gradle about resolving this configuration in the configuration phase instead of lazily too.

In the root project, it is used predeclareDepsFromBuildscript()

If I apply the convention plugin directly instead of being applied by the settings plugin this is not happening.

nedtwigg commented 1 year ago

I might be misunderstanding, but I think Spotless can't be configured from the settings.gradle. A public testcase would help.

JavierSegoviaCordoba commented 1 year ago
JavierSegoviaCordoba commented 1 year ago

repro: https://github.com/Reproducers/spotless-configuration-repro run: https://github.com/Reproducers/spotless-configuration-repro/actions/runs/4466881368/jobs/7845632387

JavierSegoviaCordoba commented 1 year ago

@nedtwigg is this correctly labeled?