import-into-eclipse.sh 4.1 KB
Newer Older
1 2 3 4
cd `dirname $0`
clear
cat <<EOM

5
------------------------------------------------------------------------
6
Spring Framework - Eclipse/STS Project Import Guide
7

8 9
This script will guide you through the process of importing the Spring
Framework projects into Eclipse or the Spring Tool Suite (STS). It is
10
recommended that you have a recent version of Eclipse or STS. As a bare
S
Sam Brannen 已提交
11 12
minimum you will need Eclipse with full Java 8 support, the AspectJ
Development Tools (AJDT), and the Groovy Compiler.
13 14 15

This script has been tested against:

S
Sam Brannen 已提交
16 17
- STS:     3.6.3.RELEASE (Eclipse Luna SR1 4.4.1)
- AJDT:    2.2.4.e44x-20141118-0700 (Luna 4.4)
18 19 20

If you need to download and install Eclipse or STS, please do that now
by visiting one of the following sites:
21

S
Spring Operator 已提交
22 23 24
- Eclipse downloads: https://download.eclipse.org/eclipse/downloads
- STS downloads: https://spring.io/tools/sts/all
- STS nightly builds: https://dist.springsource.com/snapshot/STS/nightly-distributions.html
25

26 27 28 29 30 31 32 33 34
If you need to install a recent CI build for AJDT (i.e., so that the
spring-aspects module properly compiles in Eclipse/STS), click on the
"Artifacts" tab of a successful CI build and copy the link to the
"update site" which you can then use to install or update AJDT within
Eclipse/STS.

- AJDT CI builds: https://build.spring.io/browse/AJDT-AE44

Once Eclipse/STS is installed, press enter, and we'll begin.
35 36 37 38 39 40 41 42 43 44
EOM

read

# this command:
# - wipes out any existing Eclipse metadata
# - generates OXM test classes to avoid errors on import into Eclipse
# - generates metadata for all subprojects
# - skips metadata gen for the root project (-x :eclipse) to work
#   around Eclipse's inability to import hierarchical project structures
R
Rob Winch 已提交
45
COMMAND="./gradlew --no-daemon cleanEclipse :spring-oxm:compileTestJava eclipse -x :eclipse"
46 47 48

cat <<EOM

49
------------------------------------------------------------------------
50 51
STEP 1: Generate subproject Eclipse metadata

52
The first step will be to generate Eclipse project metadata for each of
S
Sam Brannen 已提交
53 54 55 56
the spring-* subprojects. This happens via the built-in "Gradle wrapper"
script (./gradlew in this directory). If this is your first time using
the Gradle wrapper, this step may take a few minutes while a Gradle
distribution is downloaded for you.
57 58 59 60 61 62 63 64 65 66 67 68 69 70

The command run will be:

    $COMMAND

Press enter when ready.
EOM

read

$COMMAND || exit

cat <<EOM

71
------------------------------------------------------------------------
72 73 74 75
STEP 2: Import subprojects into Eclipse/STS

Within Eclipse/STS, do the following:

S
Sam Brannen 已提交
76 77 78 79 80
- File > Import... > Existing Projects into Workspace
- When prompted for the 'root directory', provide $PWD.
- Press enter. You will see the modules show up under "Projects".
- All projects should be selected/checked. Click Finish.
- When the project import is complete, you should have no errors.
81 82 83 84 85 86

When the above is complete, return here and press the enter key.
EOM

read

R
Rob Winch 已提交
87
COMMAND="./gradlew --no-daemon :eclipse"
88 89 90

cat <<EOM

91
------------------------------------------------------------------------
S
Sam Brannen 已提交
92
STEP 3: Generate root project Eclipse metadata
93

S
Sam Brannen 已提交
94 95 96 97
Unfortunately, Eclipse does not support importing project hierarchies,
so we had to skip root project metadata generation during step 1. In
this step we simply generate root project metadata so that you can
import it in the next step.
98 99 100 101 102 103 104 105 106 107 108 109 110

The command run will be:

    $COMMAND

Press the enter key when ready.
EOM

read

$COMMAND || exit

cat <<EOM
111
------------------------------------------------------------------------
112 113 114
STEP 4: Import root project into Eclipse/STS

Follow the project import steps listed in step 2 above to import the
S
Sam Brannen 已提交
115
root "spring" project.
116 117 118 119 120 121 122

Press enter when complete, and move on to the final step.
EOM

read

cat <<EOM
123
------------------------------------------------------------------------
124 125 126 127
STEP 5: Enable Git support for all projects

- In the Eclipse/STS Package Explorer, select all spring* projects.
- Right-click to open the context menu and select Team > Share Project...
S
Sam Brannen 已提交
128 129 130
- In the Share Project dialog that appears, select Git and press Next.
- Check "Use or create repository in parent folder of project".
- Click Finish.
131

132
When complete, you'll have Git support enabled for all projects.
133 134 135

You're ready to code! Goodbye!
EOM