About this Tutorial
This tutorial describes how to setup your development environment to compile/test/deploy AppFuse using Maven and your favorite IDE (Eclipse, IDEA or NetBeans). Eclipse works well for single-module projects, whereas IDEA and NetBeans work better with multi-module projects. Knowledge of Maven is not required to use AppFuse because the tutorials explain how to use it. If you're interested in learning Maven in-depth, please see Maven: The Definitive Guide (it's free!).
Table of Contents
- Download - links to download Java, Maven and MySQL
- Install - detailed instructions on where to install everything
- Configure - how to configure your environment variables
- Additional Tips - tools to boost your productivity
Downloading these files to your desktop should work just fine.
- Create a "Tools" and "SDKs" folder on your hard drive. On Windows, I create these at c:\Tools and c:\SDKs. On *nix, I usually do /opt/tools and install Java in the default locations. Make sure and install Sun's Java if you're on Linux. Now that it's GPL, it shouldn't be difficult to apt-get.
- Create Environment variables for these folders - SDKS_HOME and TOOLS_HOME (optional)
- Install Java SE (a.k.a. JDK) in the SDKs directory - keeping the directory names intact.
- Unzip/Install Maven in the Tools directory - "apache-maven-x" is what I use for the directory name, where x is the version number.
- Install MySQL in the Tools directory.
- Create a "Source" directory on your hard drive (this is where you'll put all your projects and their source code). On *nix, I usually create a "dev" folder in my home directory.
At this point, you should have a directory structure that looks something like the following:
After installing these tools, you'll need to setup an SMTP server as well. If there's an existing server you'd like to use, simply change the host name in src/main/resources/mail.properties.
Now you'll need to configure all these tools so that your operating system knows they're installed.
A Windows example is the only one shown here because it's assume the *nix folks are smart enough to figure it out for their system.
- To set Environment Variables in Windows, either go to Control Panel -> System or right-click My Computer -> Properties.
- Click on the Advanced Tab and then click the Environment Variables button.
- Put focus on the second box (System Variables) by clicking on one of the existing values.
- Enter the following variables:
- HOME = c:\Source
- SDKS_HOME = c:\SDKs
- TOOLS_HOME = c:\Tools
- JAVA_HOME = %SDKS_HOME%\jdk-1.6
- MAVEN_HOME = %TOOLS_HOME%\apache-maven-3.0.4
- MYSQL_HOME = %TOOLS_HOME%\mysql-5.5
- Append to the PATH variable: %JAVA_HOME%\bin;%MAVEN_HOME%\bin;%MYSQL_HOME%\bin
You should now be able to open a command prompt and type "java -version", "mvn -version" or "mysql" and not get errors.
- Use Cygwin on Windows for running Maven and doing all command line things. Install it in $TOOLS_HOME/cygwin.
- Use Eclipse or IDEA. Install them in $TOOLS_HOME/eclipse-x or $TOOLS_HOME/idea-x. Multi-module Maven projects seem to work best in IDEA. In Eclipse, Ctrl+Shift+R is your best friend; Ctrl+Shift+N in IDEA. See IDEs for more information on setting up an AppFuse-based project in your favorite IDE (Eclipse, IDEA, or NetBeans).
If you're starting work at a new client or at your company, you should do the following to help your development process become more efficient.
- Setup a source control system. Setting up a commit notification system is recommended when working with other developers. FishEye works great.
- Setup a bug tracking system. Popular (free) choices are Bugzilla and Trac. The best one we've seen is JIRA. For more information see What issue tracking system is best for you?
- Setup a Wiki. We love Confluence - but it's not free. Other recommended systems are JSPWiki and Trac. Trac has a wiki, source control browser and bug-tracking system all-in-one.
- Setup a development box to host the source control system, the bug tracking system, and a wiki. Install Hudson, CruiseControl, Luntbuild or Continuum on this box to do continuous integration for your project. Setting up continuous integration with a Maven 2 project is a piece-of-cake, so you have no excuses! If you're interested in commercial CI systems, checkout Pulse or Bamboo. See Which open source CI tool is best suited for your application's environment? for more information on choosing a CI Server.
- (optional) Install Roller and use it to report your daily status and issues. This will allow your client (or supervisor) to track your progress.
If installing and configuring all of this software doesn't boost your productivity, please read Tips for Productivity and Happiness at Work for more suggestions.