The following has been tested against IntelliJ IDEA 2016.2.2
以下内容已经过IntelliJ IDEA 2016.2.2的测试
Steps
Within your locally cloned spring-framework working directory:
-
Precompile
spring-oxm
with./gradlew :spring-oxm:compileTestJava
-
Import into IntelliJ (File -> New -> Project from Existing Sources -> Navigate to directory -> Select build.gradle)
-
When prompted exclude the
spring-aspects
module (or after the import via File-> Project Structure -> Modules) -
Code away
在本地克隆的spring framework工作目录中:
- 先用
./gradlew :spring-oxm:compileTestJava
编译spring-oxm
- 导入到IntelliJ(File -> New -> Project from Existing Sources -> Navigate to directory -> Select build.gradle)
- 不重要
- 随意编码
Known issues
-
spring-core
andspring-oxm
should be pre-compiled due to repackaged dependencies.
See*RepackJar
tasks in the build and https://youtrack.jetbrains.com/issue/IDEA-160605). -
spring-aspects
does not compile due to references to aspect types unknown to
IntelliJ IDEA. See https://youtrack.jetbrains.com/issue/IDEA-64446 for details. In the meantime, the
‘spring-aspects’ can be excluded from the project to avoid compilation errors. -
While JUnit tests pass from the command line with Gradle, some may fail when run from
IntelliJ IDEA. Resolving this is a work in progress. If attempting to run all JUnit tests from within
IntelliJ IDEA, you will likely need to set the following VM options to avoid out of memory errors:
-XX:MaxPermSize=2048m -Xmx2048m -XX:MaxHeapSize=2048m -
If you invoke “Rebuild Project” in the IDE, you’ll have to generate some test
resources of thespring-oxm
module again (./gradlew :spring-oxm:compileTestJava
) -
由于重新打包的依赖关系,应该先预编译
spring-core
和spring-oxm
。可以在 https://youtrack.jetbrains.com/issue/IDEA-160605查看*RepackJar
任务 -
由于IntelliJ IDEA对引用切面类型处于未知的情况,
spring-aspects
不能被编译。可以把spring-aspects
在项目中排除掉,以防止编译报错。 -
编译的过程中有可能会出现
OOM
错误,设置-XX:MaxPermSize=2048m -Xmx2048m -XX:MaxHeapSize=2048m
,以防止编译过程报错。 -
如果编译出错,解决出错后,可以重新运行命令
./gradlew :spring-oxm:compileTestJava
进行再编译