Appendix A. Setup

Table of Contents

A.1. Project Setup
Basic 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
                        
                    

Eclipse IDE 3.4 Setup

Plugin Setup

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

  2. 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 updates, add this site (from Polarion ): http://www.polarion.org/projects/subversive/download/eclipse/2.0/ganymede-site/

    • Expand 'Ganymede Update Site'/'Collaboration Tools' and select the Subversion Integration item and all the SVN items.

    • Select all items from the Polarion update site except the JavaHL Win32 items if you're not on Windows.

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

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

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

  5. 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 and the Spring Tool Suite plugin for the Eclipse IDE. 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 Spring Tool Suite for use with the SpringSource dm Server from: http://static.springsource.com/projects/sts-dm-server/update/.

    To use the SpringSource dm Server you will need to register with SpringSource at http://www.springsource.com/beta/dmserver/membershipform.php.

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 at http://www.springsource.com/beta/dmserver/membershipform.php.

Follow the instructions for installation after downloading either the binary release or the source and build the server yourself. If you're using the Spring Tool Suite 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.

  2. To download source (and/or javadocs) 'mvn eclipse:eclipse -DdownloadSources=true -DdownloadJavadocs=true' can be run, but note that the .classpath file generated doesn't correclty set the web modules. After running this, revert the .classpath file back to the original one or correctly set the jars that should be used when running the webapp.