There is a Maven 2 MyFaces project archetype that is described nicely (by Evan and Martin--you know who you are) on our VLAB Wiki.
As a starting point, here are standalone Maven 2 pom.xml and web.xml files. These will be generated by the nice archetype.
After you have gotten your app working in standalone mode, you are now ready to convert it into a portlet. Some of these details will be specific to the container you are using, but in general you will need to
- Create a portlet.xml file, placed in WEB-INF
- Modify pom.xml to add the necessary portlet and bridges jars to your dependencies.
- Modify web.xml as required by your container. For Gridsphere we will need to do this by hand but other containers (Jetspeed2, uPortal are two) will do automatically convert your web.xml when you deploy.
Here are the details. First, add the following dependencies to your POM:
<!-- Portlet Dependencies -->
A full example of pom.xml for the portlet is here..
For GridSphere, we need to add the following xml snippet to the web.xml:
A full example of the portlet's web.xml (for GridSphere) is here.