Copier Architecture

This page illustrates how the various components of the NGSS template system work together. However, it is highly recommended to become familiar with the "native" Copier workflow and its documentation, as the filegen Maven plugin is simply a wrapper around the Copier CLI, which provides more functionality the "simplified" filegen goals.

Component Diagram

Right-click the diagram and select "Open image in new tab" to view full size.
Diagram

Component Descriptions

Maven Layer

ngss-maven-tiles

Parent tiles that include and configure the filegen plugin with standard settings for NGSS projects.

ngss-filegen-maven-plugin (filegen)

Maven plugin providing both Copier-based goals and legacy static generation goals.

Copier-Based Goals (New)

These goals use Copier for intelligent template management with 3-way merge updates.

Goal Template Output

copier-init -Dcopier.template=devops

ngss-devops-template

kubernetes/, skaffold.yaml, scripts

copier-init -Dcopier.template=backstage

ngss-backstage-template

catalog-info.yaml, mkdocs.yaml, docs/

copier-update

Auto-detected from .copier-answers/

Updates existing files with 3-way merge

common-copier-config

Shared Git submodule containing reusable question definitions and context hooks for Maven project auto-detection. Included in all Copier template repositories.

Legacy Goals (Static Generation)

These goals use static templates from ckm-deployment-templates. Files are regenerated from scratch on each run (no merge capability).

Goal Description Output

jenkins-yaml

Jenkins CI/CD pipeline configuration

jenkins.yaml

generate-vv

Verification & Validation configuration

vv.yaml

generate-dibr

Deployment, Installation, Backout, Rollback guide

dibr.md

ckm-deployment-templates

Repository containing Freemarker templates for legacy file generation. Templates are fetched at build time and processed with project metadata.

Data Flow

Copier-Based Flow

  1. User includes ngss-maven-tiles in their pom.xml

  2. User runs mvn filegen:copier-init -Dcopier.template=devops

  3. Filegen invokes Copier CLI with template URL

  4. Copier prompts for configuration (with auto-detection from pom.xml)

  5. Files are generated; answers stored in .copier-answers/

  6. Updates via copier-update apply 3-way merge preserving customizations

Legacy Flow

  1. User includes ngss-maven-tiles in their pom.xml

  2. User runs mvn filegen:generate-jenkinsfile

  3. Filegen fetches template from ckm-deployment-templates

  4. Template processed with project metadata from pom.xml

  5. Files are generated (overwrites existing files completely)

Migration Path

Legacy goals will continue to work, but new projects should use Copier-based goals for:

  • DevOps configscopier-init -Dcopier.template=devops (replaces manual K8s/Skaffold setup)

  • Backstagecopier-init -Dcopier.template=backstage (new capability)

See Filegen 6.0 Migration Guide for details.