Page tree
Skip to end of metadata
Go to start of metadata

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

  1. Download - links to download Java, Maven and MySQL
  2. Install - detailed instructions on where to install everything
  3. Configure - how to configure your environment variables
  4. Additional Tips - tools to boost your productivity

Download

  1. Download Java 6+. 
  2. Download Maven 3+.
  3. Download MySQL 5.5+.

Downloading these files to your desktop should work just fine.

Install

Make sure you have 7-Zip or WinZip installed (for Windows) and gnutar for OS X before installing these packages. Linux users should be fine with the default tar tools.

  1. 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.
  2. Create Environment variables for these folders - SDKS_HOME and TOOLS_HOME (optional)
  3. Install Java SE (a.k.a. JDK) in the SDKs directory - keeping the directory names intact.
  4. Unzip/Install Maven in the Tools directory - "apache-maven-x" is what I use for the directory name, where x is the version number.
  5. Install MySQL in the Tools directory.
  6. 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.

Configure

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.

  1. To set Environment Variables in Windows, either go to Control Panel -> System or right-click My Computer -> Properties.
  2. Click on the Advanced Tab and then click the Environment Variables button.
  3. Put focus on the second box (System Variables) by clicking on one of the existing values.
  4. 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.

Additional Tips

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

  1. Setup a source control system. Setting up a commit notification system is recommended when working with other developers. FishEye works great.
  2. 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?
  3. 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.
  4. 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! (wink) 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.
  5. (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.