I was downloaded the source spring-framework-5.3.x and follow the build and export to eclipse seteps,there are no error in sts4,but when i execute the gradle task,it executed failed.That's all the logs:

Working Directory: F:\00OpenSource\SourceCode\spring-framework-5.3.x
Gradle user home: E:\gradle_user_home
Gradle Distribution: Gradle wrapper from target build
Gradle Version: 7.2
Java Home: D:\Program Files\sts-4.12.0.RELEASE\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_16.0.2.v20210721-1149\jre
JVM Arguments: None
Program Arguments: None
Build Scans Enabled: false
Offline Mode Enabled: false
Gradle Tasks: api

> Task :buildSrc:compileJava UP-TO-DATE
> Task :buildSrc:compileGroovy NO-SOURCE
> Task :buildSrc:pluginDescriptors UP-TO-DATE
> Task :buildSrc:processResources UP-TO-DATE
> Task :buildSrc:classes UP-TO-DATE
> Task :buildSrc:jar UP-TO-DATE
> Task :buildSrc:assemble UP-TO-DATE
> Task :buildSrc:pluginUnderTestMetadata UP-TO-DATE
> Task :buildSrc:compileTestJava NO-SOURCE
> Task :buildSrc:compileTestGroovy NO-SOURCE
> Task :buildSrc:processTestResources NO-SOURCE
> Task :buildSrc:testClasses UP-TO-DATE
> Task :buildSrc:test NO-SOURCE
> Task :buildSrc:validatePlugins UP-TO-DATE
> Task :buildSrc:check UP-TO-DATE
> Task :buildSrc:build UP-TO-DATE
fatal: not a git repository (or any of the parent directories): .git
> Task :spring-aop:processResources UP-TO-DATE
> Task :spring-beans:processResources UP-TO-DATE
> Task :spring-aspects:processResources UP-TO-DATE
> Task :spring-core:cglibRepackJar FAILED
> Task :spring-context:processResources UP-TO-DATE
> Task :spring-expression:processResources UP-TO-DATE
> Task :spring-context-support:processResources UP-TO-DATE
> Task :spring-jdbc:processResources UP-TO-DATE
> Task :spring-instrument:compileJava FROM-CACHE
> Task :spring-context-indexer:compileJava FROM-CACHE
> Task :spring-jcl:compileJava FROM-CACHE

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':spring-core:cglibRepackJar'.
> Failed to load cache entry for task ':spring-core:cglibRepackJar'

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

* Get more help at https://help.gradle.org

BUILD FAILED in 5s
17 actionable tasks: 1 executed, 3 from cache, 13 up-to-date
Build scan background action failed.
org.gradle.process.internal.ExecException: Process 'command 'git'' finished with non-zero exit value 128
    at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:414)
    at org.gradle.process.internal.DefaultExecAction.execute(DefaultExecAction.java:38)
    at org.gradle.process.internal.DefaultExecActionFactory.exec(DefaultExecActionFactory.java:205)
    at io.spring.ge.conventions.gradle.WorkingDirectoryProcessOperations.exec(WorkingDirectoryProcessOperations.java:45)
    at io.spring.ge.conventions.gradle.ProcessOperationsProcessRunner.run(ProcessOperationsProcessRunner.java:40)
    at io.spring.ge.conventions.gradle.BuildScanConventions.run(BuildScanConventions.java:195)
    at io.spring.ge.conventions.gradle.BuildScanConventions.addGitMetadata(BuildScanConventions.java:139)
    at com.gradle.enterprise.gradleplugin.internal.extension.b$4.run(SourceFile:177)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
    at java.base/java.lang.Thread.run(Thread.java:831)

A build scan was not published as you have not authenticated with server 'ge.spring.io'.

Comment From: JamesLiuft

I have set the java 8 build in this workspace,but I don't know when execute the gradle task to build,why the JAVA home is the default of sts4?

Comment From: JamesLiuft

Set the java home of Gradle,that's so many errors when build ~~~

:\00OpenSource\SourceCode\spring-framework-5.3.x\spring-jdbc\src\main\java\org\springframework\jdbc\core\support\JdbcBeanDefinitionReader.java:110: 错误: 对query的引用不明确
        this.jdbcTemplate.query(sql, rs -> {
                         ^
  org.springframework.jdbc.core.JdbcTemplate 中的方法 <T>query(java.lang.String,org.springframework.jdbc.core.ResultSetExtractor<T>) 和 org.springframework.jdbc.core.JdbcTemplate 中的方法 query(java.lang.String,org.springframework.jdbc.core.RowCallbackHandler) 都匹配
F:\00OpenSource\SourceCode\spring-framework-5.3.x\spring-jdbc\src\main\java\org\springframework\jdbc\core\support\JdbcBeanDefinitionReader.java:110: 错误: 不兼容的类型: 无法推断类型变量 T
        this.jdbcTemplate.query(sql, rs -> {
                               ^
    (参数不匹配; lambda 表达式中的返回类型错误
      缺少返回值)

> Task :spring-context:jar

> Task :spring-jdbc:compileJava FAILED
2 个错误

> Task :spring-messaging:compileJava
F:\00OpenSource\SourceCode\spring-framework-5.3.x\spring-messaging\src\main\java\org\springframework\messaging\handler\annotation\reactive\PayloadMethodArgumentResolver.java:235: 错误: 不兼容的类型: 无法推断类型变量 V
                            .map(buffer -> decoder.decode(buffer, elementType, mimeType, hints))
                                ^
    (参数不匹配; java.util.function.Function<capture#1, 共 ? super org.springframework.core.io.buffer.DataBuffer,capture#2, 共 ? extends capture#3, 共 ?>无法转换为java.util.function.Function<? super org.springframework.core.io.buffer.DataBuffer,? extends capture#3, 共 ?>)
F:\00OpenSource\SourceCode\spring-framework-5.3.x\spring-messaging\src\main\java\org\springframework\messaging\handler\annotation\reactive\PayloadMethodArgumentResolver.java:238: 错误: 不兼容的类型: reactor.core.publisher.Flux<java.lang.Object>无法转换为org.reactivestreams.Publisher<? extends capture#1, 共 ?>
                        flux = flux.switchIfEmpty(Flux.error(() -> handleMissingBody(parameter, message)));
                                                            ^
F:\00OpenSource\SourceCode\spring-framework-5.3.x\spring-messaging\src\main\java\org\springframework\messaging\handler\annotation\reactive\PayloadMethodArgumentResolver.java:249: 错误: 不兼容的类型: 无法推断类型变量 R
                            .map(buffer -> decoder.decode(buffer, elementType, mimeType, hints))
                                ^
    (参数不匹配; java.util.function.Function<capture#1, 共 ? super org.springframework.core.io.buffer.DataBuffer,capture#2, 共 ? extends capture#3, 共 ?>无法转换为java.util.function.Function<? super org.springframework.core.io.buffer.DataBuffer,? extends capture#3, 共 ?>)
F:\00OpenSource\SourceCode\spring-framework-5.3.x\spring-messaging\src\main\java\org\springframework\messaging\handler\annotation\reactive\PayloadMethodArgumentResolver.java:252: 错误: 不兼容的类型: reactor.core.publisher.Mono<java.lang.Object>无法转换为reactor.core.publisher.Mono<? extends capture#1, 共 ?>
                        mono = mono.switchIfEmpty(Mono.error(() -> handleMissingBody(parameter, message)));
                                                            ^
F:\00OpenSource\SourceCode\spring-framework-5.3.x\spring-messaging\src\main\java\org\springframework\messaging\rsocket\DefaultRSocketRequester.java:290: 错误: 不兼容的类型: 无法推断类型变量 R
                    .map(dataBuffer -> decoder.decode(dataBuffer, elementType, dataMimeType, EMPTY_HINTS));
                        ^
    (参数不匹配; java.util.function.Function<capture#1, 共 ? super org.springframework.core.io.buffer.DataBuffer,capture#2, 共 ? extends capture#3, 共 ?>无法转换为java.util.function.Function<? super org.springframework.core.io.buffer.DataBuffer,? extends capture#3, 共 ?>)
F:\00OpenSource\SourceCode\spring-framework-5.3.x\spring-messaging\src\main\java\org\springframework\messaging\rsocket\DefaultRSocketRequester.java:289: 警告: [cast] 出现冗余的到<any>的转换
            return (Mono<T>) payloadMono.map(this::retainDataAndReleasePayload)
                   ^
F:\00OpenSource\SourceCode\spring-framework-5.3.x\spring-messaging\src\main\java\org\springframework\messaging\rsocket\DefaultRSocketRequesterBuilder.java:211: 警告: [deprecation] org.springframework.messaging.rsocket.RSocketRequester.Builder中的connect(io.rsocket.transport.ClientTransport)已过时
    public Mono<RSocketRequester> connect(ClientTransport transport) {
                                  ^
F:\00OpenSource\SourceCode\spring-framework-5.3.x\spring-messaging\src\main\java\org\springframework\messaging\rsocket\DefaultRSocketRequesterBuilder.java:205: 警告: [deprecation] org.springframework.messaging.rsocket.RSocketRequester.Builder中的connectWebSocket(java.net.URI)已过时
    public Mono<RSocketRequester> connectWebSocket(URI uri) {
                                  ^
F:\00OpenSource\SourceCode\spring-framework-5.3.x\spring-messaging\src\main\java\org\springframework\messaging\rsocket\DefaultRSocketRequesterBuilder.java:199: 警告: [deprecation] org.springframework.messaging.rsocket.RSocketRequester.Builder中的connectTcp(java.lang.String,int)已过时
    public Mono<RSocketRequester> connectTcp(String host, int port) {
                                  ^
注: 某些消息已经过简化; 请使用 -Xdiags:verbose 重新编译以获得完整输出
5 个错误
4 个警告

> Task :spring-messaging:compileJava FAILED

> Task :spring-web:compileJava
F:\00OpenSource\SourceCode\spring-framework-5.3.x\spring-web\src\main\java\org\springframework\http\client\MultipartBodyBuilder.java:148: 错误: 不兼容的类型: 无法推断org.springframework.http.client.MultipartBodyBuilder.PublisherPartBuilder<>的类型参数
            PublisherPartBuilder<?, ?> builder = new PublisherPartBuilder<>(name, (PublisherEntity<?, ?>) part);
                                                                         ^
    原因: 推论变量 P 具有不兼容的限制范围
      等式约束条件: capture#1, 共 ?
      上限: org.reactivestreams.Publisher<capture#2, 共 ?>,org.reactivestreams.Publisher<S>
F:\00OpenSource\SourceCode\spring-framework-5.3.x\spring-web\src\main\java\org\springframework\http\client\reactive\AbstractClientHttpRequest.java:152: 错误: 不兼容的类型: 推断类型不符合上限
                .map(Supplier::get).collect(Collectors.toList());
                    ^
    推断: ? extends org.reactivestreams.Publisher<java.lang.Void>
    上限: java.lang.Object
F:\00OpenSource\SourceCode\spring-framework-5.3.x\spring-web\src\main\java\org\springframework\http\codec\support\BaseCodecConfigurer.java:193: 警告: [deprecation] org.springframework.http.codec.CodecConfigurer.CustomCodecs中的withDefaultCodecConfig(java.util.function.Consumer<org.springframework.http.codec.CodecConfigurer.DefaultCodecConfig>)已过时
        public void withDefaultCodecConfig(Consumer<DefaultCodecConfig> codecsConfigConsumer) {
                    ^
F:\00OpenSource\SourceCode\spring-framework-5.3.x\spring-web\src\main\java\org\springframework\http\codec\support\BaseCodecConfigurer.java:187: 警告: [deprecation] org.springframework.http.codec.CodecConfigurer.CustomCodecs中的writer(org.springframework.http.codec.HttpMessageWriter<?>)已过时
        public void writer(HttpMessageWriter<?> writer) {
                    ^
F:\00OpenSource\SourceCode\spring-framework-5.3.x\spring-web\src\main\java\org\springframework\http\codec\support\BaseCodecConfigurer.java:181: 警告: [deprecation] org.springframework.http.codec.CodecConfigurer.CustomCodecs中的reader(org.springframework.http.codec.HttpMessageReader<?>)已过时
        public void reader(HttpMessageReader<?> reader) {
                    ^
F:\00OpenSource\SourceCode\spring-framework-5.3.x\spring-web\src\main\java\org\springframework\http\codec\support\BaseCodecConfigurer.java:175: 警告: [deprecation] org.springframework.http.codec.CodecConfigurer.CustomCodecs中的encoder(org.springframework.core.codec.Encoder<?>)已过时
        public void encoder(Encoder<?> encoder) {
                    ^
F:\00OpenSource\SourceCode\spring-framework-5.3.x\spring-web\src\main\java\org\springframework\http\codec\support\BaseCodecConfigurer.java:169: 警告: [deprecation] org.springframework.http.codec.CodecConfigurer.CustomCodecs中的decoder(org.springframework.core.codec.Decoder<?>)已过时
        public void decoder(Decoder<?> decoder) {
                    ^
F:\00OpenSource\SourceCode\spring-framework-5.3.x\spring-web\src\main\java\org\springframework\http\codec\support\BaseDefaultCodecs.java:650: 错误: 不兼容的类型: 无法推断类型变量 R
                .map(Map.Entry::getKey)
                    ^
    (参数不匹配; java.util.function.Function<capture#1, 共 ? super java.util.Map.Entry<capture#2, 共 ?,java.lang.Boolean>,capture#3, 共 ? extends capture#2, 共 ?>无法转换为java.util.function.Function<? super java.util.Map.Entry<capture#2, 共 ?,java.lang.Boolean>,? extends capture#2, 共 ?>)
F:\00OpenSource\SourceCode\spring-framework-5.3.x\spring-web\src\main\java\org\springframework\http\server\reactive\AbstractServerHttpResponse.java:221: 错误: 无法将类 reactor.core.publisher.Mono<T>中的方法 fromCallable应用到给定类型;
                                        return writeWithInternal(Mono.fromCallable(() -> buffer)
                                                                     ^
  需要: java.util.concurrent.Callable<? extends T>
  找到: ()->buffer
  原因: 无法推断类型变量 T
    (参数不匹配; java.util.concurrent.Callable<capture#1, 共 ? extends capture#2, 共 ? extends org.springframework.core.io.buffer.DataBuffer>无法转换为java.util.concurrent.Callable<? extends capture#2, 共 ? extends org.springframework.core.io.buffer.DataBuffer>)
F:\00OpenSource\SourceCode\spring-framework-5.3.x\spring-web\src\main\java\org\springframework\http\server\reactive\AbstractServerHttpResponse.java:274: 错误: 不兼容的类型: 推断类型不符合上限
                allActions = Flux.concat(Flux.fromIterable(this.commitActions).map(Supplier::get))
                                                                                  ^
    推断: ? extends reactor.core.publisher.Mono<java.lang.Void>
    上限: java.lang.Object
5 个错误
5 个警告

> Task :spring-web:compileJava FAILED

FAILURE: Build completed with 3 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':spring-jdbc:compileJava'.
> Compilation failed; see the compiler error output for details.

* 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-messaging:compileJava'.
> Compilation failed; see the compiler error output for details.

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

3: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':spring-web:compileJava'.
> Compilation failed; see the compiler error output for details.

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

* Get more help at https://help.gradle.org

BUILD FAILED in 18s
68 actionable tasks: 11 executed, 5 from cache, 52 up-to-date
Build scan background action failed.
org.gradle.process.internal.ExecException: Process 'command 'git'' finished with non-zero exit value 128
    at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:414)
    at org.gradle.process.internal.DefaultExecAction.execute(DefaultExecAction.java:38)
    at org.gradle.process.internal.DefaultExecActionFactory.exec(DefaultExecActionFactory.java:205)
    at io.spring.ge.conventions.gradle.WorkingDirectoryProcessOperations.exec(WorkingDirectoryProcessOperations.java:45)
    at io.spring.ge.conventions.gradle.ProcessOperationsProcessRunner.run(ProcessOperationsProcessRunner.java:40)
    at io.spring.ge.conventions.gradle.BuildScanConventions.run(BuildScanConventions.java:195)
    at io.spring.ge.conventions.gradle.BuildScanConventions.addGitMetadata(BuildScanConventions.java:139)
    at io.spring.ge.conventions.gradle.BuildScanConventions$$Lambda$554/202453117.execute(Unknown Source)
    at com.gradle.enterprise.gradleplugin.internal.extension.b$4.run(SourceFile:177)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

A build scan was not published as you have not authenticated with server 'ge.spring.io'.

Comment From: bclozel

You'll need to follow the Build from source guide. We can't help you for your local setup.

Here are a few things to check: * did you really git clone the repository or just download a tarball? * it seems that the git binary is not available in your environment * the JDK version being used by Gradle might not be the right one judging from the compilation errors * you should use the local gradle wrapper, not your own Gradle install (use ./gradle.bat)