gradle最好用自己的,然后设置阿里云仓库,要不下载很慢

先到github下载spring源码5.1.x.zip,然后解压,然后通过idea -> file -> new -> project from existing sources -> 选择spring项目 --> import project from external model --> gradle -->  finish

打开后,settings -> gradle -> automatically impoert ☑️ -> build and run using 选择idea -> run tests using 选择idea -> use Gradle选择 gradle-warapper -> ok

 

等相关jar包设置好,右边gradle工具栏 -> spring-core -> tasks -> other -> 选择comileTestjava -> 左边project项目选择 spring-context -> 找到test目录 -> java目录 -> 右键随便一个package如prg.springframework run运行 这样会生成build文件夹 ->

创建自己的项目,选择主文件夹,然后new -> moudle ->选择gradle创建 ->

在自己的项目的build.gradle引入spring ,即写上

complie(project(":spring-context"))

 

Mac 上搭建spring源码

 

 

之后把spring-context的build文件夹删除,然后在重新运行spring-context的test -> java -> org.framerwork 生成新的build

之后就可以运行自己项目了,写个main方法测试

相关文章:

  • 2021-11-12
  • 2022-12-23
  • 2021-06-03
  • 2023-02-03
  • 2021-10-13
  • 2021-08-02
猜你喜欢
  • 2021-11-22
  • 2021-10-26
  • 2022-01-18
  • 2021-07-05
  • 2021-06-07
  • 2021-05-24
  • 2021-11-19
相关资源
相似解决方案