This quickstart demonstrates how to create a fully Java EE compliant project using nothing but JBoss Forge.
Once generated, the sample project will be a standard Maven 3, Java Web project with JPA 2.0, EJB 3.1, CDI 1.0, JSF 2.0 with complete JAX-RS endpoints for all data Entities. It will also provide views to Create, Read, Update, and Delete records.
But that is not all! You can use Forge on your new or existing projects to continue to enhance any application.
The application this project produces is designed to be run on Red Hat JBoss Enterprise Application Platform 6.1 or later.
All you need to build this project is Java 6.0 (Java SDK 1.6) or later and JBoss Developer Studio (JDBS) 7 or greater.
If you have not yet done so, you must Configure Maven for JBoss Developer Studio before testing the quickstarts.
Forge is available in JBoss Developer Studio. To run this example, we suggest you use JDBS 7 or greater.
Forge ConsoleWindow. To open it, navigate to menu item Window -> Show View -> Other. Locate Forge -> Forge Console and click OK.
In the Forge Console Window, navigate to the root directory of this quickstart.
$ cd QUICKSTART_HOME/forge-from-scratch/
Notice there is a file in this directory named
generate.fsh. Run this file from the Forge console using the
$ run generate.fsh
You are prompted to enter the name of the new project. Type a name for the project, for example:
? [named=The name of the new project (of type java.lang.String)]: example-application
You are prompted to accept
QUICKSTART_HOME/forge-from-scratch/example-application as the project directory. Choose
? Use [/home/username/QUICKSTART_HOME/forge-from-scratch/example-application] as project directory? [Y/n] Y
User Operation is waiting for "Importing Forge project" to complete..
[INFO] BUILD SUCCESSmessage near the end of the console output.
This quickstart created a native Java EE 6 application.
QUICKSTART_HOME/forge-from-scratch/folder. You see a folder with the same name as the project name you entered in the prompt above.
Project Explorerview in JDBS.
For a full description of what was generated by running this script and details on the structure of the application, see the Forge UI Scaffolding Guide
Run on Server. If you have more than one server, choose the JBoss EAP 6.3 Runtime server.
Upon successful deployment, a Welcome to Forge Window opens with the application running at the following URL: http://localhost:8080/PROJECT_NAME/, where PROJECT_NAME is the name you chose for your project. For example:
The application Window displays the following messages
Welcome to Forge Your application is running.
A list of entities is displayed on the left of the screen. When you click on an entity, you are provided with a form that allows you to:
The running application also provides links to find more information about the Forge.
When you are ready to undeploy the application from JBoss EAP:
OKwhen asked if you are sure you want to remove resource from the server.
generate.fsh and take a look inside! There is not much magic happening here. All of the commands used to generate this project are clearly listed just as if they were typed by your own hands.
Play around with creating more entities, relationships, UI, and generating JAX-RS endpoints,all with just a few simple commands.
Forge has a rich plugin ecosystem. Want to deploy your application to the Cloud? Use the Forge Openshift plugin: http://github.com/forge/plugin-openshift/
To see a full list of avaialable plugins, make sure that you have an active internet connection and type:
forge> forge find-plugin *