Example Project Setup
Overview
Projects can be checked out directly from the Subversion repository located at
http://svn.springbyexample.org/ 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
- Java 5 or higher installed with JAVA_HOME set.
- Download and install 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 Setup
- Download and install Eclipse (3.3 or higher, preferably the Java EE release).
- Install the Subclipse Subversion Eclipse plugin so the project can be checked out from the repository.
- Install the Spring IDE.
- Configure Maven Repository location in Eclipse.
- Setup a Subversion repository pointing to http://svn.springbyexample.org.
- Navigate to the projects trunk.
- Right click on 'trunk', select 'Checkout...', click on the 'Finish' button.
Web Setup
- Download and install a compliant Web Application Server (like Tomcat).
- Show Sever View
- Window/Show View/Others...
- Server/Servers
- Right click in the Server View and select 'New/Server'.
- Choose the an installed server.
- 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.
Maven Setup
- 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.
- 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.