9.3 Deploy As An Enterprise ARchive (EAR)

If your application is deployed as a Enterprise ARchive (EAR), typically your domain objects will be in an EJB tier and your UI screens in a WAR tier. To use Metawidget-specific annotations on your domain objects (such as @UiComesAfter) you must therefore deploy Metawidget under ear/lib. Depending on your application server, you may encounter a few problems doing this. Specifically:

All these problems can be resolved by not using metawidget-all.jar. Instead, switch to using fine-grained dependencies (eg. metawidget-facesannotation.jar in the EJB tier, metawidget-faces.jar in the WAR tier). A typical setup might be:

ear/lib                              # EJB tier annotations	
   metawidget-annotation.jar
   metawidget-core.jar
   metawidget-facesannotation.jar
ear/war/WEB-INF/lib                  # WAR tier inspectors/widgets
   metawidget-faces.jar
   metawidget-hibernatevalidator.jar
   metawidget-jpa.jar
   metawidget-richfaces.jar
   metawidget-tomahawk.jar

To use fine-grained dependencies, specify dependencies on a per-technology basis using Maven. For example:

Maven will automatically drag in related dependencies for you, such as org.metawidget.modules:metawidget-core. You can browse all available fine-grained dependencies at http://repository.jboss.org/nexus/content/groups/public-jboss/org/metawidget/modules. If you are not using Maven, you can also download and deploy the fine-grained dependencies manually.