重要提醒:
文章中提到的:spring-oxm
和:compileTestJava
都應該是英文:
,而不是中文:
,但因為markdown的無法正常現實兩個英文冒號之間的文字,所以下面統一用中文冒號代替英文冒號了,實際輸入和執行命令時需要改正過來!
import-into-idea.md
英文原文:
The following has been tested against 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
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 http://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 the spring-oxm
module again (./gradlew :spring-oxm:compileTestJava
)
Tips
In any case, please do not check in your own generated .iml, .ipr, or .iws files.
You'll notice these files are already intentionally in .gitignore. The same policy goes for eclipse metadata.
FAQ
Q. What about IntelliJ IDEA's own Gradle support?
A. Keep an eye on http://youtrack.jetbrains.com/issue/IDEA-53476
中文翻譯
以下內容已針對IntelliJ IDEA 2016.2.2進行了測試
步驟:
在本地克隆的spring-framework工作目錄中:
使用以下語句預編譯spring-oxm
./gradlew:spring-oxm:compileTestJava
導入IntelliJ(File - >New - >Project from Existing Sources - > Navigate to directory - > 選擇build.gradle)
提示時排除spring-aspects模塊(或通過File-> Project Structure -> Modules導入后)
Code away
已知的問題
-
由於重新打包的依賴關系,應該預編譯
spring-core
和spring-oxm
。請參閱構建中的* RepackJar
任務和https://youtrack.jetbrains.com/issue/IDEA-160605)。 -
“spring-aspects”由於引用IntelliJ IDEA未知的切面類型而無法編譯。 有關詳細信息,請參見http://youtrack.jetbrains.com/issue/IDEA-64446。 在此期間,可以從項目中排除'spring-aspects'以避免編譯錯誤。
-
當JUnit測試從Gradle命令行傳遞時,一些測試在從Intellij IDEA運行時可能會失敗。敗。 解決這個問題正在進行中。 如果嘗試從IntelliJ IDEA內運行所有JUnit測試,您可能需要設置以下VM選項以避免內存不足錯誤:
-XX:MaxPermSize = 2048m -Xmx2048m -XX:MaxHeapSize = 2048m
-
如果在IDE中調用“Rebuild Project”,則必須生成一些測試'spring-oxm'模塊的資源(
./gradlew:spring-oxm:compileTestJava
)
提示
任何情況下,請不要簽入自己生成的.iml、.ipr或.iws文件。您會注意到這些文件已經有意放在.gitignore中。Eclipse元數據也采用同樣的策略。
常見問題
問:Intellij Idea自己的Gradle支持怎么樣?
a.關注https://youtrack.jetbrains.com/issue/idea-53476
import-into-eclipse.md
英文原文
This document will guide you through the process of importing the Spring Framework projects into Eclipse or the Spring Tool Suite (STS). It is recommended that you have a recent version of Eclipse or STS. As a bare minimum you will need Eclipse with full Java 8 support, the AspectJ Development Tools (AJDT), and the Groovy Compiler.
The following instructions have been tested against Spring Tool Suite (STS) 3.9.4 and 4.0.0.M11 with Eclipse Buildship (Eclipse Plug-ins for Gradle). The instructions should work with the latest Eclipse distribution as long as you install Buildship. Note that STS 4 comes with Buildship preinstalled.
Steps
Within your locally cloned spring-framework working directory:
-
Precompile spring-oxm with
./gradlew :spring-oxm:compileTestJava
-
Import into Eclipse (File -> Import -> Gradle -> Existing Gradle Project -> Navigate to directory -> Select Finish)
-
If prompted, exclude the spring-aspects module (or after the import by closing or deleting the project)
-
In the spring-oxm project, add the jaxb folder in build/generated-sources to the build path (right click on them and select Build Path -> Use as Source Folder)
-
To apply project specific settings run ./gradlew eclipseBuildship
-
Code away
Known Issues
- spring-core and spring-oxm should be pre-compiled due to repackaged dependencies.
- See *RepackJar tasks in the build.
- spring-aspects does not compile due to references to aspect types unknown to Eclipse.
- If you install AJDT into Eclipse it should work.
- While JUnit tests pass from the command line with Gradle, some may fail when run from the IDE.
- Resolving this is a work in progress.
- If attempting to run all JUnit tests from within the IDE, you will likely need to set the following VM options to avoid out of memory errors: -XX:MaxPermSize=2048m -Xmx2048m -XX:MaxHeapSize=2048m
Tips
In any case, please do not check in your own generated .classpath file, .project file, or .settings folder. You'll notice these files are already intentionally in .gitignore. The same policy holds for IDEA metadata.
中文翻譯
已知問題
1. 由於重新打包的依賴關系,應該預先編譯spring-core和spring-oxm。
- 請參見構建中的
*RepackJar
任務。
2. 由於對Eclipse未知的切面類型的引用,spring-aspects無法編譯。
- 如果將AJDT安裝到Eclipse中,它應該可以工作。
3. 當junit測試通過命令行並使用gradle時,有些測試在從IDE運行時可能會失敗。
- 解決此問題正在進行中。
- 如果試圖從IDE中運行所有JUnit測試,可能需要設置以下VM選項以避免內存不足錯誤:
-xx:maxpermsize=2048m-xmx2048m-xx:maxheapsize=2048m
提示
在任何情況下,請不要簽入自己生成的.classpath文件、.project文件或.settings文件夾。您會注意到這些文件已經有意放在.gitignore中。IDEA元數據也有相同的策略。