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.
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 two folders (castor
andjaxb
) inbuild/generated-sources
to the build path (right click on them and selectBuild Path -> Use as Source Folder
) - To apply project specific settings run
./gradlew eclipseBuildship
- Code away
spring-core
andspring-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
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.