导入idea并编译spring源码

源码中有个文件 import-into-idea.md 。按照里面的步骤操作即可:

  1. 源码目录中执行 ./gradlew :spring-oxm:compileTestJava。前提是需要安装 gradle。
  2. 导入idea
    Import into IntelliJ (File -> New -> Project from Existing Sources -> Navigate to directory -> Select build.gradle)
  3. 编译执行 ./gradlew build
    编译、测试、构建、分布
    To compile, test, build all jars, distribution zips, and docs
  4. ./gradlew -a :spring-webmvc:test 命令可以只编译spring-webmvc。
    Gradle有很好的增量构建支持,所以运行时不需要执行clean命令,这样就可以保持快速运行。您还可以使用“-a”标志和“:project”前缀来避免评估和构建其他模块。例如,如果迭代Spring-webmvc中的更改,则运行以下代码只对该模块进行评估和构建 ./gradlew -a :spring-webmvc:test
    Gradle has good incremental build support so run without clean to keep things snappy. You can also use the "-a" flag and the ":project" prefix to avoid evaluating and building other modules. For example, if iterating over changes in spring-webmvc, run with the following to evaluate and build only that module:
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容