Following is a simple way to create a portlet with the JBossForge Tool:

1) Start the forge


_____
|  ___|__  _ __ __ _  ___
| |_ / _ \| `__/ _` |/ _ \  \\
|  _| (_) | | | (_| |  __/  //
|_|  \___/|_|  \__, |\___|
|___/

[no project] portlet-demo $

2) Install portlet-plugin

The Portlet plugin is not yet listed in the Forge plugin repository. You need to use the git url to install it. In Forge type:

forge git-plugin git://github.com/jerr/plugin-portlet.git

That’s it! The plugin will be downloaded and installed.

3) Setting up a portlet project

From the forge prompt, create a new project and install the PortletFacet. This sets up your pom.xml.

new-project --named HelloForge  --topLevelPackage org.demo
portlet setup

4) Generating a simple portlet

Once the Facet is installed, you can create new portlet.

portlet new-portlet --named HelloPortlet

5) Building the war archive

Using maven we compile and package the web archive

mvn install

5) Deploy it

If you used GateIn, add the new archive in the  deployment directory. Via the admin page, import the portlet and add it in a page.

Here is the result.

Tags: ,