This release contains several bug fixes, improvements to code generation (with AMP) and upgrades Spring to version 2.5. Since this is a minor release, we're not using any of Spring 2.5's features, but there's nothing stopping you from using them. The new annotations are particularly exciting.
To learn more about Spring 2.5's features, see InfoQ's What's New in Spring 2.5: Part 1 article.
Please see the Upgrade Guide below or the QuickStart Guide to get started with this release. If you're upgrading from a previous release, you may be interested in the changelog.
If you're currently using AppFuse 2.0, there's a few things you'll need to change to upgrade to 2.0.1. If you're using a version prior to 2.0, you may want to follow previous upgrade instructions first.
The easiest way to make the changes below might be to compare your |
The tutorial applications have been upgraded from 2.0 to 2.0.1. Looking at the diffs for these projects may be one of the easiest ways to upgrade.
If you've used mvn war:inplace in your project, make sure you remove your WEB-INF/classes and re-run war:inplace:
|
The following are a detailed set of steps you'll need to do if you're manually upgrading your project from a previous 2.x version.
pom.xml, change <appfuse.version> to 2.0.1 and <spring.version> to 2.5.touch src/main/webapp/* touch src/main/webapp/scripts/* touch src/main/webapp/WEB-INF/* touch src/main/webapp/WEB-INF/pages/* |
find src/main -print0 | xargs -r0 touch |
<dependentWarExcludes> to prevent the files from being overlayed.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.
Generating CRUD with AMP
You can run the following command to generate CRUD screens/classes for a POJO:
mvn appfuse:gen -Dentity=Name |
If you don't specify the entity name, you will be prompted for it. Currently, if a @Column has "nullable = false", a "required field" validation rule will be generated as part of the web framework's validation configuration. This command will also install the generated code, unless you specify -DdisableInstallation=true.
If your entity is not defined in hibernate.cfg.xml, it will be added.
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). If you want to generate specific code in a "war" project, you can use gen-core or gen-web.
You can run mvn appfuse:remove to remove the artifacts installed by appfuse:gen. |
There's also a goal that allows you to generate model objects from database tables.
appfuse:gen-model |
This goal will install the generated files into your source tree, unless you specify -DdisableInstallation=true. After running this command, you can use appfuse:gen to generate CRUD classes/tests/screens for this object.
Installing AppFuse's source into your project
The good news is creating an "old style" project is now pretty easy. After you've create a new project using 2.x, you can run the following command:
mvn appfuse:full-source |
This goal will convert your project to use all of AppFuse's source and remove all dependencies on AppFuse.
What the full-source plugin does:
org.appfuse to your project's groupId.If you have issues developing AppFuse in Eclipse or NetBeans because of the WarPath plugin, running appfuse:full-source should fix that problem. It removes the warpath plugin as part of its installation process.