springboot 2.3.x build failed( I had execute ./gradlew -p buildSrc format):

$ gradle  build -x test
> Task :spring-boot-project:spring-boot-actuator-autoconfigure:asciidoctor FAILED
> Task :spring-boot-project:spring-boot-actuator:checkFormatMain FAILED
> Task :spring-boot-project:spring-boot-autoconfigure:checkFormatMain FAILED

FAILURE: Build completed with 3 failures.

1: Task failed with an exception.
-----------
* What went wrong:
A problem was found with the configuration of task ':spring-boot-project:spring-boot-actuator-autoconfigure:asciidoctor' (type 'AsciidoctorTask').
> Directory 'C:\GIT\learn\spring-boot\spring-boot-project\spring-boot-actuator-autoconfigure\build\generated-snippets' specified for property '$3' does not exist.

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':spring-boot-project:spring-boot-actuator:checkFormatMain'.
> Formatting violations found in the following files:
   * src\main\java\org\springframework\boot\actuate\amqp\package-info.java

Comment From: wilkinsona

You should run the build using the wrapper to ensure that the correct version of Gradle is used. You should also verify that your line ending settings are correct. IIRC, you need to configure Windows with core.autocrlf set to true.

Also, please note that 2.3.x is no longer supported. 2.7.x and main (3.0.x) are the only supported branches at this time.

Comment From: liangliplus

I have the same problem, I used branch 2.3x, and I had execute ./gradlew :spring-boot-project:spring-boot-actuator-autoconfigure:build -x , which prompted me to fail. I tried to set git config --global core.autocrlf true, but it still fails。

  • What went wrong: A problem was found with the configuration of task ':spring-boot-project:spring-boot-actuator-autoconfigure:asciidoctor' (type 'AsciidoctorTask').

    Directory 'D:\source-workspace\spring-boot-2.3x\spring-boot-project\spring-boot-actuator-autoconfigure\build\generated-snippets' specified for property '$3' does not exist.

  • 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.

core.autocrlf=true

Comment From: wilkinsona

You appear to have a different problem, @liangliplus. You have run the build with tests disabled. That will not work as the Actuator API documentation uses Spring REST Docs-based tests to produce some of its content.