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.0.4+.
- 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.
|Choose your Stack|
AppFuse comes in a number of different flavors. To optimize and simplify your experience as a user, we've created a number of different archetypes (a.k.a. starter projects). There are currently three types of AppFuse Archetypes: light, basic and modular. Light archetypes are bare-bones, basic archetypes contain User Management and Security and modular archetypes contain "core" and "web" modules and are ideal for creating projects that have a re-usable backend. You should change the groupId to match your preferred package name and the artifactId to match your project's name.
|The warnings you see when creating your project are expected. If you see BUILD SUCCESS at the end, your project was created successfully.|
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 hibernate3 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.
The default username/password for an admin user is admin/admin. For a regular user, use user/user.
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.
|Changing database settings|
To change your MySQL database settings, simply change the <jdbc.*> properties at the bottom of your pom.xml. See Database Profiles to use a database other than MySQL.
Develop your application
You can develop your application using Eclipse, IDEA or NetBeans. For Eclipse, install m2e 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.