I wanted to write a quick note about my progress on the AppFuse Maven Plugin (AMP) in the last couple weeks. In its current state, 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
I'd like to figure out a way to combine these or at least allow "appfuse:gen appfuse:install -Dentity=Name", but that's currently not possible (since both depend on compile happening first).
The "gen" mojo handles all the dao and web frameworks, but the install plugin does not. Currently, it's hard-coded to Struts-only.
The good news is there's tests to verify the generation functionality (mostly it checks that files were created in the correct location). I tried to programmatically generate a project and run "gen install" on it, but the MavenEmbedder does not handle plugin extensions properly and fails on the warpath plugin. That being said, we may be able to use it to aggregate multiple mojo calls into a single one.
Since the MavenEmbedder didn't work, I added a build.xml file to plugins/appfuse-maven-plugin that verifies everything work. Typing "ant" in this directory will create a project, copy a Person.java object into it's model package and run "gen install integration-test". This all seems to work reasonably well.
This plugin is probably not as flexible as the former Ant Task-based plugin, but it does work. The most important part is the FreeMarker templates and most of that is done. Also, the install is done using Ant Tasks (parsing and replacing XML), so I believe the majority of the work is re-usable.
I hope to complete the first version of this plugin in the next week.
![]()
The AppFuse Team is pleased to announce the release of AppFuse 2.0 M5!
This release marks a milestone in the features of AppFuse 2.x. This release adds CRUD code generation, full source support (just like 1.x) and XFire integration. In addition, we've fixed all the issues related to switching persistence frameworks, and you should now be able to easily switch from using Hibernate to iBATIS or JPA. The videos have been updated for M5. The Easy CRUD with Struts 2 video shows how code generation currently works.
AppFuse 2.0 is available as a Maven archetype. For information on creating a new project using this release, please see the QuickStart Guide or the Hello World video.
If you've used AppFuse 1.x, but not 2.x, you'll want to read the FAQ. Join the user mailing list if you have any questions. The Maven Reference Guide has a map of Ant -> Maven commands. Maven for Newbies might also be useful if you've never used Maven before. There is some support for Ant in this release.
For more information, please see the 2.0 M5 Release Notes. If you'd like to use AppFuse offline, you may want to download the dependencies and extract them into your Maven ~/.m2/repository directory.
The 2.0 series of AppFuse has a minumum requirement of the following specification versions:
- Java Servlet 2.4 and JavaServer Pages (JSP) 2.0
- Java 5 for Development (Java 1.4 for deployment using the Retrotranslator Plugin)
We appreciate the time and effort everyone has put toward contributing code and documentation, posting to the mailing lists, and logging issues.