Coffee Builder for Jakarta EE

Coffee Builder generates the foundation. The developer builds the application.

Coffee Builder Maven Plugin

Maven Central Version GitHub last commit GitHub GitHub Actions Workflow Status

The Coffee Builder Maven Plugin incrementally adds Jakarta EE capabilities to an existing Maven project.

It does not generate a complete application or impose a predefined architecture. Each goal performs a focused transformation while keeping the resulting project understandable, editable, and under the developer’s control.

Coffee Builder generates the foundation. The developer builds the application.

How Coffee Builder Works

Coffee Builder can be used at different stages of a Jakarta EE project.

  1. Create a clean foundation
    The Jakarta EE Essentials Archetype can create a minimal Jakarta EE project with a clear Maven structure and only the essential configuration.

  2. Add capabilities when needed
    The Coffee Builder Maven Plugin can extend that foundation incrementally — or it can be used with an existing Jakarta EE Maven project.

  3. Continue developing normally
    Coffee Builder performs the repetitive setup and generation steps, then leaves the resulting code and configuration in the project for the developer to inspect, modify, and continue building.

You can stop after creating the foundation, use only selected plugin goals, or continue adding capabilities as the application evolves.

Coffee Builder works like a customizable project template that can evolve over time, without requiring AI-generated code or consuming AI tokens.

Build incrementally. Keep the project yours.

Usage

The plugin can be invoked directly from the command line without adding it to the project’s pom.xml:

mvn io.github.coffee-builder:coffee-builder-maven-plugin:0.0.8:<goal>

For example:

mvn io.github.coffee-builder:coffee-builder-maven-plugin:0.0.8:add-persistence

Parameters can be supplied with standard Maven system properties:

mvn io.github.coffee-builder:coffee-builder-maven-plugin:0.0.8:<goal> \
    -D<option>=<value>

Example: Evolving an Application Incrementally

A project created with the Jakarta EE Essentials Archetype can be extended one capability at a time.

For example:

# Add persistence support
mvn io.github.coffee-builder:coffee-builder-maven-plugin:0.0.8:add-persistence

# Add entities from a JSON definition
mvn io.github.coffee-builder:coffee-builder-maven-plugin:0.0.8:add-entities \
    -Dentities-file=entities.json

# Generate application model layers
mvn io.github.coffee-builder:coffee-builder-maven-plugin:0.0.8:add-domain-models \
    -Dentities-file=entities.json

# Generate a server-side API from OpenAPI
mvn io.github.coffee-builder:coffee-builder-maven-plugin:0.0.8:create-openapi \
    -Dopenapi-server=openapi.yaml

Each operation changes the existing Maven project. You can inspect, edit, or extend those changes manually before invoking another Coffee Builder goal.

Plugin Goals

Jakarta EE

add-validation-api

Adds Jakarta Validation API dependencies to enable annotation-based validation such as @NotNull and @Size.

mvn io.github.coffee-builder:coffee-builder-maven-plugin:0.0.8:add-validation-api

Persistence and Data

add-persistence

Configures Jakarta Persistence in the project, including the persistence unit and Data Source configuration.

mvn io.github.coffee-builder:coffee-builder-maven-plugin:0.0.8:add-persistence

Parameters

Parameter Description Default
persistence-unit-name Persistence unit name. defaultPU
datasource-name Data Source JNDI name. defaultDatasource
url JDBC connection URL. H2 in-memory
user Database user.  
password Database password.  
declare Location where the resource is declared. web

add-datasource

Adds Data Source configuration to the project.

mvn io.github.coffee-builder:coffee-builder-maven-plugin:0.0.8:add-datasource

It uses the same Data Source options documented for add-persistence.

add-entities

Generates Jakarta Persistence entities from a JSON entity definition.

mvn io.github.coffee-builder:coffee-builder-maven-plugin:0.0.8:add-entities \
    -Dentities-file=entities.json

Parameters

Parameter Description Required
entities-file Path to the JSON file containing the entity definitions. Yes

Example entity definition

{
  "Category": {
    "fields": {
      "id": {
        "type": "UUID",
        "isId": true,
        "generatedValue": "UUID"
      },
      "name": {
        "type": "String",
        "column": {
          "length": 100
        }
      }
    }
  },
  "Pet": {
    "fields": {
      "id": {
        "type": "Long",
        "isId": true,
        "generatedValue": "Identity"
      },
      "category": {
        "type": "Category",
        "manyToOne": true,
        "joinColumn": {
          "name": "category_id",
          "nullable": false
        }
      },
      "name": {
        "type": "String",
        "column": {
          "length": 100
        }
      },
      "status": {
        "type": "String"
      }
    }
  }
}

See examples/entities.json.


Application Model

add-domain-models

Generates application model layers from the entity definition, including DTOs, mappers, repository interfaces, and services.

mvn io.github.coffee-builder:coffee-builder-maven-plugin:0.0.8:add-domain-models \
    -Dentities-file=entities.json

Parameters

Parameter Description Required
entities-file Path to the JSON entity definition file. Yes

The entity definition becomes the input used to create the related application model components.


Jakarta REST and OpenAPI

create-openapi

Generates server-side code from an OpenAPI specification.

mvn io.github.coffee-builder:coffee-builder-maven-plugin:0.0.8:create-openapi \
    -Dopenapi-server=openapi.yaml

Parameters

Parameter Description Default
openapi-server Path to the OpenAPI specification in YAML or JSON format. ${project.basedir}/openapi.yml

See examples/openapi.yaml.


Jakarta Faces

add-faces

Configures Jakarta Faces in the project, including required dependencies, the Faces declaration, and the welcome file configuration.

mvn io.github.coffee-builder:coffee-builder-maven-plugin:0.0.8:add-faces

Parameters

Parameter Description Default
welcome-file Welcome file for the web application. index.xhtml

add-face-template

Creates a Facelet template.

mvn io.github.coffee-builder:coffee-builder-maven-plugin:0.0.8:add-face-template \
    -Dname=/WEB-INF/templates/main.xhtml \
    -Dinserts=header,body,footer

Parameters

Parameter Description Required
name Name or path of the Facelet template to create. Yes
inserts Comma-separated list of names for ui:insert elements. No

add-face-page

Creates a Jakarta Faces page and can optionally create the associated backing bean or use an existing Facelet template.

mvn io.github.coffee-builder:coffee-builder-maven-plugin:0.0.8:add-face-page \
    -Dname=hello-world \
    -Dmanaged-bean=false

Another example:

mvn io.github.coffee-builder:coffee-builder-maven-plugin:0.0.8:add-face-page \
    -Dname=persons \
    -Dmanaged-bean=true

Parameters

Parameter Description Default
name Page name without the extension. Required
managed-bean Whether to create an associated backing bean. true
template Optional Facelet template to use for the page.  

add-forms-from-entities

Generates Jakarta Faces/PrimeFaces forms from entity and form definitions.

mvn io.github.coffee-builder:coffee-builder-maven-plugin:0.0.8:add-forms-from-entities \
    -Dentities-file=entities.json \
    -Dforms-file=forms.json

Parameters

Parameter Description Required
entities-file Path to the JSON entity definition file. Yes
forms-file Path to the JSON form definition file. Yes

Example form definition

{
  "CategoryList": {
    "entity": "Category",
    "title": "Categories List",
    "base": "/",
    "template": {
      "facelet": "/WEB-INF/templates/template1.xhtml",
      "define": "body"
    },
    "fields": {
      "id": {
        "label": "Category Id"
      },
      "name": {
        "label": "Category Name"
      }
    }
  }
}

See examples/forms.json.


Runtime

add-glassfish-embedded

Adds a Maven profile configured to run the application with GlassFish Embedded.

mvn io.github.coffee-builder:coffee-builder-maven-plugin:0.0.8:add-glassfish-embedded

Parameters

Parameter Description Default
profile Maven profile ID to create. glassfish
port GlassFish HTTP port. 8080
contextRoot Application context root. ${project.build.finalName}

add-payaramicro

Adds the Payara Micro Maven plugin and its Maven profile to the project.

mvn io.github.coffee-builder:coffee-builder-maven-plugin:0.0.8:add-payaramicro

Parameters

Parameter Description Default
profile Maven profile ID to create. payaramicro

Next Steps

Coffee Builder handles repetitive project setup so you can focus on the application itself.

After running a goal, inspect the generated or modified files, adapt them to your application’s needs, and continue developing with the Jakarta EE and Maven tooling you already use.

For the initial project foundation, see the Jakarta EE Essentials Archetype.

For source code, issues, and development information, visit the Coffee Builder Maven Plugin repository.