Compile spring 5.2.0 source code

Time:2021-9-22

Download spring-framework-5.2.0.release.zip

https://github.com/spring-projects/spring-framework/releases

Download gradle 5.6.3 and follow the instructions to configure the environment variables

https://gradle.org/install/

Unzip the zip and view the files in the root directoryimport-into-idea.md

Execute script (Windows system)

.\gradlew.bat :spring-oxm:compileTestJava

After success, open with idea

Compile spring 5.2.0 source code

Compile spring 5.2.0 source code

After successfully opening the project, we will unload the spring aspects module

Compile spring 5.2.0 source code

Then we can create a new module for our own use

openproject structuer

Compile spring 5.2.0 source code

Then we introduce some spring jar packages that we need to use for this new module

Compile spring 5.2.0 source code

When using spring in our new module, the following problems may occur

java: cannot find symbol
  symbol:   variable CoroutinesUtils
  location: class org.springframework.core.ReactiveAdapterRegistry.CoroutinesRegistrar
  Error:(348, 51) java: cannot find symbol
  symbol:   variable CoroutinesUtils
  location: class org.springframework.core.ReactiveAdapterRegistry.CoroutinesRegistrar

terms of settlement

Take thisspring-core/kotlin-coroutines/build/libs/kotlin-coroutines-5.2.0.RELEASE.jarIt can be imported into the project

The second possible problem

Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/cglib/core/NamingPolicy        

The spring corebuild/libofspring-cglib-repack-3.3.0.jarandspring-objenesis-repack-3.0.1.jarIntroduced into the new module

So far, we can use spring normally in the new module

Compile spring 5.2.0 source code