Appendix A. Setup

Table of Contents

A.1. Project Setup
Basic Setup
Project Checkout
SpringSource Tool Suite Setup
General Eclipse IDE Setup

A.1. Project Setup

The latest Spring by Example repository is available at https://github.com/spring-by-example/spring-by-example.

Older projects can be checked out directly from the Subversion repository located at http://svn.springbyexample.org/.

The projects were setup to be imported as Maven projects into Eclipse, but because of some issues some Eclipse files are checked for reference. Maven can also be used to generate IntelliJ project files.

$ mvn idea:idea

Basic Setup

  1. Java 7 or higher installed with JAVA_HOME set.

  2. Download and install to use Maven from the command line. Maven (version 3.x or higher).

  3. Install Git.

Example Environment Settings

These are the ~/.bash_profile settings for a Mac.

                        
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_10.jdk/Contents/Home
MAVEN_OPTS="-Xms256m -Xmx1024m -XX:MaxPermSize=256M"

PATH=$PATH:JAVA_HOME/bin

export JAVA_HOME MAVEN_OPTS
                        
                    

Project Checkout

Checkout the project using Git from Spring By Example Repository. The first command will checkout all of the current Spring by Example projects, and the second will checkout the specific tag that corresponds to this document.

$ git clone git://github.com/spring-by-example/spring-by-example.git
$ cd spring-by-example
$ git checkout sbe-1.4
                

SpringSource Tool Suite Setup

Download and install the SpringSource Tool Suite Download. It's free and simplifies the IDE setup. The SpringSource Tool Suite is based on the Eclipse IDE, but has all the SpringSource plugins installed as well as others like for AspectJ and Maven.

General Eclipse IDE Setup

Import Project

  1. Do an Eclipse import of the desired project to work with from within the git clone.

Web Setup

  1. Download and install a compliant Web Application Server (like Tomcat or the VMware vFabric tc Server).

  2. Show Sever View

    • Window/Show View/Others...

    • Server/Servers

  3. Right click in the Server View and select 'New/Server'.

    • Choose the installed server (for example Tomcat if that is the server you chose to install).

  4. Right click on project and select 'Run As'/'Run on Server'.

    • Choose the server to run the project on.

    • Click on Next.

    • Click on Finish.

    • This should launch the application and also open up a browser window in Eclipse pointing to the webapps home page.