Spring源码导入IDEA/eclipse官方指南


重要提醒:

文章中提到的: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:

  1. Precompile spring-oxm with ./gradlew :spring-oxm:compileTestJava

  2. Import into IntelliJ (File -> New -> Project from Existing Sources -> Navigate to directory -> Select build.gradle)

  3. When prompted exclude the spring-aspects module (or after the import via File-> Project Structure -> Modules)

  4. Code away

Known issues

  1. spring-core and spring-oxm should be pre-compiled due to repackaged dependencies.

See *RepackJar tasks in the build and https://youtrack.jetbrains.com/issue/IDEA-160605).

  1. 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.

  1. 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
  1. 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

已知的问题

  1. 由于重新打包的依赖关系,应该预编译spring-corespring-oxm。请参阅构建中的* RepackJar任务和https://youtrack.jetbrains.com/issue/IDEA-160605)。

  2. “spring-aspects”由于引用IntelliJ IDEA未知的切面类型而无法编译。 有关详细信息,请参见http://youtrack.jetbrains.com/issue/IDEA-64446。 在此期间,可以从项目中排除'spring-aspects'以避免编译错误。

  3. 当JUnit测试从Gradle命令行传递时,一些测试在从Intellij IDEA运行时可能会失败。败。 解决这个问题正在进行中。 如果尝试从IntelliJ IDEA内运行所有JUnit测试,您可能需要设置以下VM选项以避免内存不足错误:-XX:MaxPermSize = 2048m -Xmx2048m -XX:MaxHeapSize = 2048m

  4. 如果在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:

  1. Precompile spring-oxm with ./gradlew :spring-oxm:compileTestJava

  2. Import into Eclipse (File -> Import -> Gradle -> Existing Gradle Project -> Navigate to directory -> Select Finish)

  3. If prompted, exclude the spring-aspects module (or after the import by closing or deleting the project)

  4. 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)

  5. To apply project specific settings run ./gradlew eclipseBuildship

  6. Code away

Known Issues

  1. spring-core and spring-oxm should be pre-compiled due to repackaged dependencies.
  • See *RepackJar tasks in the build.
  1. spring-aspects does not compile due to references to aspect types unknown to Eclipse.
  • If you install AJDT into Eclipse it should work.
  1. 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元数据也有相同的策略。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM