NOTE: This issue is specific to IntelliJ.
IntelliJ reports the following error:
The CheckStyle rules file could not be parsed. cannot initialize module io.spring.javaformat.checkstyle.SpringChecks - Unable to instantiate 'io.spring.javaformat.checkstyle.SpringChecks' class, it is also not possible to instantiate it as null. Please recheck that class name is specified as canonical name or read how to configure short name usage http://checkstyle.sourceforge.net/config.html#Packages. Please also recheck that provided ClassLoader to Checker is configured correctly. The file has been blocked for 60s
The IntelliJ CheckStyle configuration has the following as the active configuration:
<entry key="active-configuration" value="PROJECT_RELATIVE:$PROJECT_DIR$/etc/checkstyle/checkstyle.xml:spring-security" />
This is the root cause of the error, as io.spring.javaformat.checkstyle.SpringChecks is not available within IntelliJ's classpath. Furthermore, the spring-javaformat-gradle-plugin automatically discovers the CheckStyle rules and applies it at build time.
Removing the active configuration resolves this error.