To start developing web applications with AppFuse, please following the instructions below:
Table of Contents
Create a project
- Setup your Development Environment - or follow the steps below if you're a veteran.
- Download and install JDK 7+ (make sure your JAVA_HOME environment variable points to the JDK, not a JRE).
- Download and install MySQL 5.5+ (or use a different database see here).
- Setup a local SMTP server or change
mail.properties(in src/main/resources) to use a different host name - it defaults to "localhost".
- Download and install Maven 3.1.0+.
- From the command line, cd into your "Source" directory (c:\Source on Windows, ~/dev on Unix) run the Maven command you see below after choosing your web framework and other options.
You should be able to run AppFuse immediately if you have a MySQL 5.x database installed and it's accessible to root using no password. If you'd prefer to use an embedded database, we've recently added Database Profiles for H2, HSQLDB, etc.
Run your application
Running AppFuse is easy now. Once the archetype project is created, Maven will create and populate your database using the hibernate4 and dbunit plugins, respectively. All you have to do is use Maven to run the Jetty container and view your application.
Decide if you want to change AppFuse from "embedded mode" to full-source mode by running mvn appfuse:full-source from your project's root directory. Embedded mode means the service layer is contained in JARs vs. having the source in your project.
To view your application run mvn jetty:run from your project's directory (for a modular project, you'll need to run mvn jetty:run from your project's web directory (after installing the core module)). Maven will start Jetty and you should be able to view your application in your browser at http://localhost:8080.
- Check your new project into source control, unless you have a good reason not to. Google Code, GitHub, and BitBucket are good options.
Run mvn from within your project to download JARs, Tomcat and run the integration tests in your project.
If you receive OutOfMemory errors when using mvn jetty:run, increase the memory available to Java. For example, set your JAVA_OPTS environment variable to -Xmx1024M -XX:PermSize=512m.
Develop your application
You can develop your application using Eclipse, IDEA or NetBeans. For Eclipse use File > Import > Existing Maven Projects and import your project. For IDEA, simply use File > Open Project and point to your project's directory. Further instructions can be found in the IDE Reference Guide.
The Tutorials should help you get started developing your application.