Build

In principle you can build the generated code with any build tool that can handle Java code. The most popular ones are Apache Maven and Gradle.

Minimal Input Model

To use the Maven generation functionality of the JSF generators, you must model at least one organization, one application-ui and one capability:

Organization.gapp

namespace org.gs.gapp.rt;

module Organization kind = Product;

organization nameofyourcompany;

Applications.gapp

namespace com.your.namespace;

module Applications kind = Product;

application-ui MyApplication {}

Capabilities.gapp

namespace com.your.namespace;

module Capabilities kind = Product, Basic;

capability MyCapability {
    link UiApplications = MyApplication;
}

Apache Maven

The JSF generators are capable of generating Maven build files (POM files) that can be used out-of-the-box to build and deploy a generated web application. The generated POM files include the dependencies to other components that are required to build and deploy the web application. You may have to manually add more dependencies when you write code that needs additional components. Typcially, you only need this at the very begining of a web app project. Later you most probably have set up a common parent POM file that has all the configuration set up that is common to all web apps you are going to develop. When this is the case, simply leave the virtual project Maven unmapped.

When you start from scratch, the following steps are your quickest route to a building and running web application. The following steps assume that you are using the Virtual Developer Cloud Connector for Maven. The generated build files have the component dependencies set up that are described here.

Generate Maven Files with JSF Web-Fragment

  1. Configure a pom-gen.xml file with the Virtual Developer Cloud Connector Maven plugin and the minimum input model set up.
  2. Map the virtual project Maven of the generator JSF Web-Fragment to a directory DIR on your filesystem.
  3. Generate → You get a POM file in DIR and two subdirectories UI and INTERF therein, where each of them contains a POM file.
  4. Map the virtual projects
    JSF Web FragmentUI
    JSF Web Fragment InterfacesINTERF
    Selenium Base Tests -> UI
    and generate again.
  5. Executing maven clean install on the POM in DIR now should successfully build the generated code.

Generate Maven Files with JSF Application

  1. Configure a pom-gen.xml file with the Virtual Developer Cloud Connector Maven plugin and the minimum input model set up.
  2. Map the virtual project Maven of the generator JSF Application to a directory DIR on your filesystem.
  3. Generate → You get a POM file in DIR.
  4. Map the virtual projects
    JSF Web AppDIR
    Selenium TestsDIR
    JSON Test DataDIR
    and generate again.
  5. Executing maven clean install on the POM in DIR now should successfully build the generated code.

Tip

To use the generated code in your Java IDE, simply use the IDE’s Maven import functionality. When working with an IDE you can run the Maven based code generation from within the IDE.

Gradle

There is not yet a Virtual Developer Cloud Connector for Gradle.