Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ tagline = "Build the foundation. Keep control of your application."
hide_page_title = true
hide_sidebar = true
hide_seo_title_suffix = true
hide_breadcrumb = true
+++
41 changes: 41 additions & 0 deletions content/goals/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
+++
title = "Goal Reference"
+++

This reference documents every user-facing goal in `org.eclipse.coffeebuilder:coffee-builder-maven-plugin:0.1.0-SNAPSHOT`. The inventory and parameters are derived from the current plugin descriptor and Mojo implementations.

> **Snapshot contract:** These commands use a locally installed development snapshot. Begin with [Getting Started]({{< relref "/getting-started" >}}), and review changes in the target project after each invocation.

## Goal index {#goal-index}

| Category | Goal | Purpose |
|---|---|---|
| Jakarta EE | [`add-validation-api`]({{< relref "/goals/jakarta-ee" >}}#add-validation-api) | Add the version-appropriate Bean Validation API. |
| Persistence and data | [`add-persistence`]({{< relref "/goals/persistence-data" >}}#add-persistence) | Establish persistence and a first datasource. |
| Persistence and data | [`add-datasource`]({{< relref "/goals/persistence-data" >}}#add-datasource) | Add or configure a datasource in an existing persistence foundation. |
| Persistence and data | [`add-entities`]({{< relref "/goals/persistence-data" >}}#add-entities) | Generate entities, enums, and entity repository interfaces. |
| Application model | [`add-domain-models`]({{< relref "/goals/application-model" >}}#add-domain-models) | Generate domain models and application-layer contracts. |
| Jakarta Faces | [`add-faces`]({{< relref "/goals/faces" >}}#add-faces) | Configure Jakarta Faces dependencies and application metadata. |
| Jakarta Faces | [`add-face-template`]({{< relref "/goals/faces" >}}#add-face-template) | Create a Facelets template. |
| Jakarta Faces | [`add-face-page`]({{< relref "/goals/faces" >}}#add-face-page) | Create a Facelets page and optional managed bean. |
| Jakarta Faces | [`add-forms-from-entities`]({{< relref "/goals/faces" >}}#add-forms-from-entities) | Generate PrimeFaces CRUD screens from entity and form definitions. |
| REST and OpenAPI | [`create-openapi`]({{< relref "/goals/rest-openapi" >}}#create-openapi) | Configure server-side OpenAPI generation. |
| Runtime | [`add-glassfish-embedded`]({{< relref "/goals/runtime" >}}#add-glassfish-embedded) | Add an embedded GlassFish Maven profile. |
| Runtime | [`add-payaramicro`]({{< relref "/goals/runtime" >}}#add-payaramicro) | Add a version-selected Payara Micro Maven profile. |

The plugin also contains Maven's generated [`help`]({{< relref "/goals/help" >}}#help) goal. It reports plugin metadata and is not an application-transforming Coffee Builder goal.

## Invocation {#invocation}

```shell
mvn org.eclipse.coffeebuilder:coffee-builder-maven-plugin:0.1.0-SNAPSHOT:<goal> \
-D<option>=<value>
```

Maven-injected project, session, and component fields are intentionally excluded from the parameter tables. Return to the [Maven Plugin overview]({{< relref "/maven-plugin" >}}) for the operating model and target-project expectations.

## Inputs and generated code {#inputs}

`add-entities` and `add-domain-models` share an `entities-file` input. `add-forms-from-entities` combines that entity definition with a `forms-file`. This phase describes how each goal uses those inputs; a complete input-file schema belongs in a later reference phase. Current sample files are available in the canonical repository's [plugin examples directory](https://github.com/eclipse-ee4j/coffeebuilder/tree/develop/coffee-builder-maven-plugin/examples).

Generated Java, descriptors, pages, and POM changes remain part of the target project and are fully editable.
46 changes: 46 additions & 0 deletions content/goals/application-model/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
+++
title = "Application Model Goals"
+++

[Goal Reference]({{< relref "/goals" >}}) / Application model

## add-domain-models {#add-domain-models}

**Category:** Application model

Reads the same entity-definition JSON used by `add-entities` and generates an application-facing model layer plus mapping and repository/service types.

### Prerequisites

- An existing Maven project with a detectable Jakarta EE 10 or 11 API dependency.
- A valid entity-definition file.
- In practice, run [`add-entities`]({{< relref "/goals/persistence-data" >}}#add-entities) first. The generated implementations refer to the entity and entity-repository types created by that goal.

### Parameters

| Maven property | Type | Required | Default | Meaning |
|---|---|---:|---|---|
| `entities-file` | `File` | Yes | — | Path to the JSON entity definition. |

### Effects

For each configured entity, the goal generates:

- a domain model/DTO under `domain.model`;
- a MapStruct mapper under `infrastructure.mapper`;
- an abstract model repository and entity-specific repository contract under `domain.repository`;
- an implementation under `infrastructure.domain` that uses the generated entity repository and mapper;
- application service types where defined by the generator templates.

It also adds MapStruct configuration—including annotation processing—to `pom.xml` when absent, and adds the Jakarta Transactions API when needed. The current implementation resolves a MapStruct version through Maven metadata while it prepares that configuration, so first execution may require repository access.

### Example

```shell
mvn org.eclipse.coffeebuilder:coffee-builder-maven-plugin:0.1.0-SNAPSHOT:add-domain-models \
-Dentities-file=config/entities.json
```

Use the same entity definition that was supplied to `add-entities`; differing inputs can produce incompatible layers. The current [entities example](https://github.com/eclipse-ee4j/coffeebuilder/blob/develop/coffee-builder-maven-plugin/examples/entities.json) is a concise illustration, not a full input-file reference.

[View the current Mojo source](https://github.com/eclipse-ee4j/coffeebuilder/blob/develop/coffee-builder-maven-plugin/src/main/java/org/eclipse/coffeebuilder/mojo/arch/AddDomainModelsMojo.java).
146 changes: 146 additions & 0 deletions content/goals/faces/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
+++
title = "Jakarta Faces Goals"
+++

[Goal Reference]({{< relref "/goals" >}}) / Jakarta Faces

## add-faces {#add-faces}

**Category:** Jakarta Faces

Adds Jakarta Faces and CDI dependencies appropriate to the project's Jakarta EE version and creates application configuration for Faces.

### Prerequisites

- An existing Maven project with a detectable Jakarta EE 10 or 11 API dependency.
- The conventional web layout when a welcome file is to be updated.

### Parameters

| Maven property | Type | Required | Default | Meaning |
|---|---|---:|---|---|
| `welcome-file` | `String` | No | `index.xhtml` | Welcome file added when an existing `WEB-INF/web.xml` can be updated. |

### Effects

- Adds the Jakarta Faces API and CDI API dependencies when absent.
- Selects Faces API `4.0.1` for Jakarta EE 10 and `4.1.2` for Jakarta EE 11 from the embedded catalog.
- Generates `FacesConfiguration.java` under the derived `app.faces` package with Faces configuration and CDI application-scope annotations.
- Adds the configured welcome file to an existing `src/main/webapp/WEB-INF/web.xml`.

The goal does not add a servlet mapping. If `web.xml` is absent, the current helper skips the welcome-file update.

### Example

```shell
mvn org.eclipse.coffeebuilder:coffee-builder-maven-plugin:0.1.0-SNAPSHOT:add-faces \
-Dwelcome-file=index.xhtml
```

## add-face-template {#add-face-template}

**Category:** Jakarta Faces

Creates a Facelets template containing named insertion points.

### Prerequisites

- A web project using the conventional `src/main/webapp` layout.
- [`add-faces`](#add-faces) is the practical setup step before generating UI files.

### Parameters

| Maven property | Type | Required | Default | Meaning |
|---|---|---:|---|---|
| `name` | `String` | Yes | — | Template path relative to `src/main/webapp`; a leading `/` is removed and `.xhtml` is added if omitted. |
| `inserts` | `List<String>` | No | — | Names for generated `ui:insert` regions. Supply a comma-separated Maven list. |

### Effects

- Creates the named `.xhtml` template under `src/main/webapp`.
- Adds one `ui:insert` region for each supplied insertion name.
- Does not change `pom.xml` or generate a managed bean.

### Example

```shell
mvn org.eclipse.coffeebuilder:coffee-builder-maven-plugin:0.1.0-SNAPSHOT:add-face-template \
-Dname=templates/main \
-Dinserts=header,content,footer
```

## add-face-page {#add-face-page}

**Category:** Jakarta Faces

Creates a Facelets page and, by default, its CDI managed bean.

### Prerequisites

- A web project using `src/main/webapp`.
- Run [`add-faces`](#add-faces) first.
- When `template` is supplied, that template file must already exist; [`add-face-template`](#add-face-template) can create it.

### Parameters

| Maven property | Type | Required | Default | Meaning |
|---|---|---:|---|---|
| `name` | `String` | Yes | — | Page path relative to `src/main/webapp`; `.xhtml` is added if omitted. |
| `managed-bean` | `boolean` | No | `true` | Whether to generate the page's CDI managed bean. |
| `template` | `String` | No | — | Existing Facelets template path used by the page. |

### Effects

- Creates the requested `.xhtml` page under `src/main/webapp`.
- When a template is selected, generates definitions for the template's discovered `ui:insert` regions.
- With `managed-bean=true`, creates a PascalCase `<PageName>Bean.java` under the derived `app.faces` package and references it from the page.
- Does not change `pom.xml`.

### Example

```shell
mvn org.eclipse.coffeebuilder:coffee-builder-maven-plugin:0.1.0-SNAPSHOT:add-face-page \
-Dname=inventory/list \
-Dtemplate=templates/main.xhtml \
-Dmanaged-bean=true
```

## add-forms-from-entities {#add-forms-from-entities}

**Category:** Jakarta Faces

Combines entity and form-definition JSON files to generate PrimeFaces CRUD screens and their backing beans.

### Prerequisites

- A Faces-enabled web project; run [`add-faces`](#add-faces) first.
- Existing entity-layer output from [`add-entities`]({{< relref "/goals/persistence-data" >}}#add-entities).
- **Practical prerequisite:** existing domain models and repository contracts from [`add-domain-models`]({{< relref "/goals/application-model" >}}#add-domain-models). This goal references those types and does not independently create missing domain model types.
- Valid entity and form-definition files. If a form selects a template, that Facelets template must exist.

### Parameters

| Maven property | Type | Required | Default | Meaning |
|---|---|---:|---|---|
| `entities-file` | `File` | Yes | — | Path to the JSON entity definition used by the generated types. |
| `forms-file` | `File` | Yes | — | Path to the JSON form/page definition. |

### Effects

- Resolves a current `org.primefaces:primefaces` version through Maven artifact metadata and adds it with the `jakarta` classifier when absent.
- Generates PrimeFaces CRUD `.xhtml` pages under `src/main/webapp`.
- Generates CDI managed beans under the derived `app.faces` package.
- Creates `src/main/resources/messages.properties`.
- References the pre-existing domain models and repository contracts in generated backing code.

The current [entity](https://github.com/eclipse-ee4j/coffeebuilder/blob/develop/coffee-builder-maven-plugin/examples/entities.json) and [form](https://github.com/eclipse-ee4j/coffeebuilder/blob/develop/coffee-builder-maven-plugin/examples/forms.json) examples illustrate paired inputs. They are not a substitute for the later full input-file reference.

### Example

```shell
mvn org.eclipse.coffeebuilder:coffee-builder-maven-plugin:0.1.0-SNAPSHOT:add-forms-from-entities \
-Dentities-file=config/entities.json \
-Dforms-file=config/forms.json
```

[View the Faces Mojo sources](https://github.com/eclipse-ee4j/coffeebuilder/tree/develop/coffee-builder-maven-plugin/src/main/java/org/eclipse/coffeebuilder/mojo/faces).
28 changes: 28 additions & 0 deletions content/goals/help/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
+++
title = "Maven Help Goal"
+++

[Goal Reference]({{< relref "/goals" >}}) / Maven-generated help

## help {#help}

The `help` goal is generated by the Maven Plugin Plugin. It displays the plugin's goals and parameter metadata; it does not generate or modify application code.

### Parameters

| Maven property | Type | Required | Default | Meaning |
|---|---|---:|---|---|
| `detail` | `boolean` | No | `false` | Show the full set of goal details. |
| `goal` | `String` | No | — | Limit output to one goal. |
| `indentSize` | `int` | No | `2` | Number of spaces used for each indentation level. |
| `lineLength` | `int` | No | `80` | Maximum display line length. |

### Example

```shell
mvn org.eclipse.coffeebuilder:coffee-builder-maven-plugin:0.1.0-SNAPSHOT:help \
-Ddetail=true \
-Dgoal=add-persistence
```

Because `help` describes the locally installed descriptor, it is also a useful way to inspect the exact snapshot present in a developer's Maven repository.
6 changes: 0 additions & 6 deletions content/goals/index.md

This file was deleted.

36 changes: 36 additions & 0 deletions content/goals/jakarta-ee/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
+++
title = "Jakarta EE Goals"
+++

[Goal Reference]({{< relref "/goals" >}}) / Jakarta EE

## add-validation-api {#add-validation-api}

**Category:** Jakarta EE

Adds the Bean Validation API dependency appropriate to the Jakarta EE version declared by the target project.

### Prerequisites

- An existing Maven project with a detectable Jakarta EE 10 (`10.0.0`) or Jakarta EE 11 (`11.0.0`) API dependency.

### Parameters

This goal has no user-facing parameters.

### Effects

- Adds `jakarta.validation:jakarta.validation-api` with `provided` scope if it is not already present.
- Adds the associated version property to `pom.xml`.
- Selects Validation API `3.0.2` for Jakarta EE 10 and `3.1.1` for Jakarta EE 11 from the embedded catalog.
- Does not generate Java source or descriptors.

### Example

```shell
mvn org.eclipse.coffeebuilder:coffee-builder-maven-plugin:0.1.0-SNAPSHOT:add-validation-api
```

The goal recognizes the two exact Jakarta EE platform versions above; another version is not silently treated as compatible.

[View the current Mojo source](https://github.com/eclipse-ee4j/coffeebuilder/blob/develop/coffee-builder-maven-plugin/src/main/java/org/eclipse/coffeebuilder/mojo/jakartaee/AddValidationApiMojo.java).
Loading
Loading