Appendix A. Setup

Table of Contents

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

A.1. Project Setup

Projects can be checked out directly from the Subversion repository located at http://svn.springbyexample.org/springindepth/ or using an IDE.

The projects were setup to checkout directly into Eclipse, but Maven can also be used to generate IntelliJ project files ('mvn idea:idea'). The project is also setup to use the Spring IDE.

Basic Setup

  1. Java 5 or higher installed with JAVA_HOME set.

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

Example Environment Settings

Optionally you can set MAVEN_OPTS to increase it's memory settings.

                        
JAVA_HOME=/usr/local/java
M2_HOME=/usr/local/maven
MAVEN_OPTS="-Xms128m -Xmx512m"

PATH=$JAVA_HOME/bin:$M2_HOME/bin:$PATH

export JAVA_HOME M2_HOME MAVEN_OPTS
                        
                    

SpringSource Tool Suite Setup

Download and install the SpringSource Tool Suite Download. It's free, although registration is required, 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.

Plugin Setup

  1. Install the Subversive (Subversion plugin) so projects can be checked out from the repository.

    • In the Available Software tab under 'Help/Software Updates...', add the following sites by clicking on the 'Add Site...' button.

      • http://download.eclipse.org/technology/subversive/0.7/update-site/
      • http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/
    • Select all items from each update site except the JavaHL Win32 items if you're not on Windows from the Polarion site. For more information see Subversive Installation Instructions and Polarion's Subversive Download Info.

    • Click on the Install button, click on Next, accept the license, and then click on Finish.

  2. Optional: SpringSource dm Server

    To work with the SpringSource dm Server and the examples using it, you will need to install the SpringSource dm Server.

    To use the SpringSource dm Server you will need to register with SpringSource before downloading from Download SpringSource dm Server.

Eclipse IDE 3.4 Setup

Download and install Eclipse 3.4, preferably the Java EE release.

Plugin Setup

  1. Install the Subversive Subversion Eclipse plugin (replacement for Subclipse for Eclipse 3.4) so the project can be checked out from the repository.

    • In the Available Software tab under 'Help/Software Updates...', add the following sites by clicking on the 'Add Site...' button.

      • http://download.eclipse.org/technology/subversive/0.7/update-site/
      • http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/
    • Select all items from each update site except the JavaHL Win32 items if you're not on Windows from the Polarion site. For more information see Subversive Installation Instructions and Polarion's Subversive Download Info.

    • Click on the Install button, click on Next, accept the license, and then click on Finish.

  2. Install the Spring IDE .

    • Installation Instructions

    • Adding the Spring IDE update site to Eclipse will also add the AspectJ AJDT update site. Select all of the Spring IDE items except the Dependency one (not for use with Eclipse 3.4) and all of the AJDT items.

    • Click on the Install button, click on Next, accept the license, and then click on Finish.

  3. Install the M2Eclipse plugin developed by Sonatype for Maven support. It will allow easier management of Maven project files and also allow multi-module project support in the Eclipse IDE.

    In the Available Software updates, add the update site from the bottom of http://m2eclipse.codehaus.org/.

  4. Optional: SpringSource dm Server

    To work with the SpringSource dm Server and the examples using it, you will need to install the SpringSource dm Server the SpringSource dm Server plugin for Eclipse. The plugin will let you define the server in Eclipse's server view, create projects to deploy to the server, and help manage bundle dependencies and downloads from the SpringSource Enterprise Bundle Repository.

    Install the plugin from: http://static.springsource.com/projects/sts-dm-server/update/.

    To use the SpringSource dm Server you will need to register with SpringSource before downloading from Download SpringSource dm Server.

General Eclipse IDE Setup

Subversion Setup

  1. Setup a Subversion repository pointing to http://svn.springbyexample.org/springindepth/.

Project Checkout

  1. Navigate to the projects trunk using the Subversion repository browser.

  2. Right click on 'trunk', select 'Checkout...', click on the 'Finish' button.

Web Setup

  1. Download and install a compliant Web Application Server (like Tomcat or the SpringSource dm 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.

SpringSource dm Server Setup

To use the SpringSource dm Server you will need to register with SpringSource before downloading from Download SpringSource dm Server.

Follow the instructions for installation after downloading either the binary release or the source and build the server yourself. If you're using the server plugin in the Eclipse IDE, you'll be able to start and stop the server inside Eclipse. Otherwise there are startup and shutdown scripts in the bin directory.

Maven Setup

[Note]Note

This setup is unnecessary when using M2Eclispe Plugin in the Eclipse IDE. The M2Eclilpse plugin will handle downloading any jars and Maven builds can be run inside the Eclipse IDE. Also the plugin can download source and javadoc jars as well as the plugin automatically handling the projects classpath using the dependencies from the pom.xml.

  1. From the command line (or the Maven Eclipse Plugin can be used) run 'mvn package' from the project directory at least once. This will download all the required jars.