- AppFuse Maven Plugin: This plugin is a replacement for AppGen in AppFuse 1.x. It's used for code generation, as well as other AppFuse-related tasks. See the list below for current enhancement ideas.
- Cargo Maven Plugin: Used to start and stop containers before and after running integration tests (i.e. with Canoo WebTest or Selenium).
- DbUnit Maven Plugin: This plugin is a wrapper around DbUnit and is used to populate the database with sample data before running tests.
- Hibernate3 Maven Plugin: Used to create the database schema when using Hibernate or JPA for the DAO framework.
- Maven Jetty Plugin: Used to run an embedded Jetty instance from Maven.
- Maven WarPath Plugin: Used to provide features to Maven so WARs can have dependencies.
- Native2Ascii Maven Plugin: Converts i18n bundles from native to ascii format.
- SQL Maven Plugin: Used to create the database schema when using iBATIS for the DAO framework.
- Tomcat Maven Plugin: Similar to the Maven Jetty Plugin - can start an embedded Tomcat instance to deploy your project or manage a remote instance.
For more plugins, see available Maven plugins and the Maven 2 Plugins Project (also known as Mojo).
About the AppFuse Maven Plugin
This release marks the first release of the AppFuse Maven Plugin (AMP). This plugin currently does two things: 1) code generation for CRUD and 2) allows you to convert your project to use AppFuse's source instead of using its binary dependencies. For more information on this plugin, see http://static.appfuse.org/plugins/appfuse-maven-plugin.
Generating CRUD with AMP
In the AppFuse 2.0 M5 release, you can run the following command to generate CRUD screens/classes for a POJO:
appfuse:gen -Dentity=Name
If you don't specify the entity name, you're prompted for it. After generating the code, you can install it using:
appfuse:install -Dentity=Name
Your entity must be defined in your hibernate.cfg.xml file for this to work. In a modular project, these commands must be run in the "core" and "web" modules. The plugin is smart enough to figure out when it should/should not generate stuff based on the packaging type (jar vs. war). In a future release, we hope to combine "gen" and "install" into a single command.
There's also a goal that allows you to generate model objects from database tables:
appfuse:gen-model
This goal does not install the generated files into your source tree, so you'll need to manually copy it. If you want to generate CRUD for the object, you'll also want to add it to your hibernate.cfg.xml.
We hope to combine these commands in a future release.
Installing AppFuse's source into your project
The good news is creating an "old style" project is now pretty easy. If you create a new project using 2.0-m5-SNAPSHOT, you can now use:
mvn appfuse:full-source
This goal will convert your project to use all of AppFuse's source and remove all dependencies on AppFuse. Known issues with "full-source" include:
- It only supports basic archetypes. It will likely only take a couple of hours to add modular project support, so this feature will be in the next release.
- It doesn't do package renaming. We plan to add this as part of the next release.
What the full-source plugin does:
- Exports all sources from Subversion into your project. It reads the dao.framework and web.framework properties to determine what you need.
- Removes warpath plugin from pom.xml.
- Calculates dependencies by reading pom.xml files form the various AppFuse modules. It replaces your dependencies with these new ones. The order of the dependencies added is alphabetical based on groupId.
- Reads properties from the root AppFuse pom.xml and adds the ones that don't exist to your project. Since these are stored in a java.util.Properties, I was unable to sort them alphabetically.
Goals available:
Goal | Description |
---|---|
appfuse:gen-core | Generates Java classes for DAOs and Managers from set of annotated POJOs |
appfuse:gen-web | Generates Java classes for DAOs and Managers from set of annotated POJOs |
appfuse:gen | Generates Java classes from set of annotated POJOs |
appfuse:hbmtemplate | Generic exporter that can be controlled by a user provided template or class. |
appfuse:gen-model | Generates Java classes from set of *.hbm.xml files |
appfuse:install | This mojo is used to "install" generated artifacts (Java files, XML files) into an AppFuse project. |
appfuse:full-source | This mojo is used to "install" source artifacts from Subversion into an AppFuse project. |