源碼中有個(gè)文件 import-into-idea.md 兼搏。按照里面的步驟操作即可:
- 源碼目錄中執(zhí)行 ./gradlew :spring-oxm:compileTestJava。前提是需要安裝 gradle秦踪。
- 導(dǎo)入idea
Import into IntelliJ (File -> New -> Project from Existing Sources -> Navigate to directory -> Select build.gradle) - 編譯執(zhí)行 ./gradlew build
編譯秋秤、測(cè)試、構(gòu)建、分布
To compile, test, build all jars, distribution zips, and docs - ./gradlew -a :spring-webmvc:test 命令可以只編譯spring-webmvc跟伏。
Gradle有很好的增量構(gòu)建支持,所以運(yùn)行時(shí)不需要執(zhí)行clean命令翩瓜,這樣就可以保持快速運(yùn)行受扳。您還可以使用“-a”標(biāo)志和“:project”前綴來(lái)避免評(píng)估和構(gòu)建其他模塊。例如兔跌,如果迭代Spring-webmvc中的更改勘高,則運(yùn)行以下代碼只對(duì)該模塊進(jìn)行評(píng)估和構(gòu)建 ./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: